Class LmrsData
java.lang.Object
org.opentrafficsim.road.gtu.lane.tactical.util.lmrs.LmrsData
- All Implemented Interfaces:
DesireBased,Synchronizable
Keeps data for LMRS for a specific GTU.
Copyright (c) 2013-2024 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
- 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
ConstructorsConstructorDescriptionLmrsData(Synchronization synchronization, Cooperation cooperation, GapAcceptance gapAcceptance, Tailgating tailgating) -
Method Summary
Modifier and TypeMethodDescription(package private) voidRemembers the leaders of the current time step (those forwarded to isNewLeader()) for the next time step.(package private) CooperationReturns the cooperation.Returns the desire map.(package private) GapAcceptanceReturn the gap-acceptance.getLatestDesire(Class<? extends Incentive> incentiveClass) Returns the latest desire from the specified incentive.(package private) SynchronizationReturns the synchronization.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) TailgatingReturn the tail gating.(package private) boolean(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.toString()
-
Constructor Details
-
LmrsData
public LmrsData(Synchronization synchronization, Cooperation cooperation, GapAcceptance gapAcceptance, Tailgating tailgating) - Parameters:
synchronization- synchronizationcooperation- cooperationgapAcceptance- gap-acceptancetailgating- tail gating
-
-
Method Details
-
isNewLeader
Checks if the given leader is a new leader.- Parameters:
gtu- 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
Remembers the gtu that is synchronized to.- Parameters:
gtu- gtu that is synchronized to
-
isSyncVehicle
Returns whether the provided gtu is the gtu that is synchronized to.- Parameters:
gtu- gtu to inquiry- Returns:
- whether the provided gtu is the gtu that is synchronized to
-
getSyncVehicle
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- 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
Description copied from interface:DesireBasedReturns the latest desire from the specified incentive.- Specified by:
getLatestDesirein interfaceDesireBased- Parameters:
incentiveClass- incentive class- Returns:
- latest desire from the specified incentive
-
getDesireMap
Returns the desire map.- Returns:
- desire map
-
setSynchronizationState
Sets the synchronization state.- Parameters:
synchronizationState- Synchronizable.State; synchronization step
-
getSynchronizationState
Description copied from interface:SynchronizableReturns the synchronization state.- Specified by:
getSynchronizationStatein interfaceSynchronizable- Returns:
- synchronization state
-
isHumanLongitudinalControl
boolean isHumanLongitudinalControl()- Returns:
- humanLongitudinalControl.
-
setHumanLongitudinalControl
public void setHumanLongitudinalControl(boolean humanLongitudinalControl) - Parameters:
humanLongitudinalControl- set humanLongitudinalControl.
-
toString
-