Class LmrsData
- java.lang.Object
-
- org.opentrafficsim.road.gtu.lane.tactical.util.lmrs.LmrsData
-
- All Implemented Interfaces:
DesireBased,Synchronizable
public final class LmrsData extends Object implements DesireBased, Synchronizable
Keeps data for LMRS for a specific GTU.Copyright (c) 2013-2022 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.- Version:
- $Revision$, $LastChangedDate$, by $Author$, initial version 8 nov. 2016
- Author:
- Alexander Verbraeck, Peter Knoppers, Wouter Schakel
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.opentrafficsim.road.gtu.lane.tactical.Synchronizable
Synchronizable.State
-
-
Constructor Summary
Constructors Constructor Description LmrsData(Synchronization synchronization, Cooperation cooperation, GapAcceptance gapAcceptance, Tailgating tailgating)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) voidfinalizeStep()Remembers the leaders of the current time step (those forwarded to isNewLeader()) for the next time step.(package private) CooperationgetCooperation()Returns the cooperation.(package private) Map<Class<? extends Incentive>,Desire>getDesireMap()Returns the desire map.(package private) GapAcceptancegetGapAcceptance()Return the gap-acceptance.DesiregetLatestDesire(Class<? extends Incentive> incentiveClass)Returns the latest desire from the specified incentive.(package private) SynchronizationgetSynchronization()Returns the synchronization.Synchronizable.StategetSynchronizationState()Returns the synchronization state.(package private) HeadwayGTUgetSyncVehicle(PerceptionCollectable<HeadwayGTU,LaneBasedGTU> adjLeaders)Returns the gtu from the set that is the current sync vehicle, ornullof there is no sync vehicle or it is not in the set.(package private) TailgatinggetTailgating()Return the tail gating.(package private) booleanisHumanLongitudinalControl()(package private) booleanisNewLeader(HeadwayGTU gtu)Checks if the given leader is a new leader.(package private) booleanisSyncVehicle(HeadwayGTU gtu)Returns whether the provided gtu is the gtu that is synchronized to.voidsetHumanLongitudinalControl(boolean humanLongitudinalControl)(package private) voidsetSynchronizationState(Synchronizable.State synchronizationState)Sets the synchronization state.(package private) voidsetSyncVehicle(HeadwayGTU gtu)Remembers the gtu that is synchronized to.StringtoString()
-
-
-
Constructor Detail
-
LmrsData
public LmrsData(Synchronization synchronization, Cooperation cooperation, GapAcceptance gapAcceptance, Tailgating tailgating)
- Parameters:
synchronization- Synchronization; synchronizationcooperation- Cooperation; cooperationgapAcceptance- GapAcceptance; gap-acceptancetailgating- Tailgating; tail gating
-
-
Method Detail
-
isNewLeader
boolean isNewLeader(HeadwayGTU gtu)
Checks if the given leader is a new leader.- Parameters:
gtu- HeadwayGTU; gtu to check- Returns:
- whether the gtu is a new leader
-
finalizeStep
void finalizeStep()
Remembers the leaders of the current time step (those forwarded to isNewLeader()) for the next time step.
-
setSyncVehicle
void setSyncVehicle(HeadwayGTU gtu)
Remembers the gtu that is synchronized to.- Parameters:
gtu- HeadwayGTU; gtu that is synchronized to
-
isSyncVehicle
boolean isSyncVehicle(HeadwayGTU gtu)
Returns whether the provided gtu is the gtu that is synchronized to.- Parameters:
gtu- HeadwayGTU; gtu to inquiry- Returns:
- whether the provided gtu is the gtu that is synchronized to
-
getSyncVehicle
HeadwayGTU getSyncVehicle(PerceptionCollectable<HeadwayGTU,LaneBasedGTU> adjLeaders)
Returns the gtu from the set that is the current sync vehicle, ornullof there is no sync vehicle or it is not in the set.- Parameters:
adjLeaders- PerceptionCollectable<HeadwayGTU,LaneBasedGTU>; leaders in adjacent lane- Returns:
- gtu from the set that is the current sync vehicle
-
getSynchronization
Synchronization getSynchronization()
Returns the synchronization.- Returns:
- synchronization
-
getCooperation
Cooperation getCooperation()
Returns the cooperation.- Returns:
- cooperation
-
getGapAcceptance
GapAcceptance getGapAcceptance()
Return the gap-acceptance.- Returns:
- gap-acceptance
-
getTailgating
Tailgating getTailgating()
Return the tail gating.- Returns:
- gap-acceptance
-
getLatestDesire
public Desire getLatestDesire(Class<? extends Incentive> incentiveClass)
Returns the latest desire from the specified incentive.- Specified by:
getLatestDesirein interfaceDesireBased- Parameters:
incentiveClass- Class<? extends Incentive>; incentive class- Returns:
- latest desire from the specified incentive
-
getDesireMap
Map<Class<? extends Incentive>,Desire> getDesireMap()
Returns the desire map.- Returns:
- Map<Class<? extends Incentive>, Desire>; desire map
-
setSynchronizationState
void setSynchronizationState(Synchronizable.State synchronizationState)
Sets the synchronization state.- Parameters:
synchronizationState- Synchronizable.State; synchronization step
-
getSynchronizationState
public Synchronizable.State getSynchronizationState()
Returns the synchronization state.- Specified by:
getSynchronizationStatein interfaceSynchronizable- Returns:
- State; synchronization state
-
isHumanLongitudinalControl
boolean isHumanLongitudinalControl()
- Returns:
- humanLongitudinalControl.
-
setHumanLongitudinalControl
public void setHumanLongitudinalControl(boolean humanLongitudinalControl)
- Parameters:
humanLongitudinalControl- boolean; set humanLongitudinalControl.
-
-