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
ConstructorDescriptionLmrsData
(Synchronization synchronization, Cooperation cooperation, GapAcceptance gapAcceptance, Tailgating tailgating) -
Method Summary
Modifier and TypeMethodDescription(package private) void
Remembers the leaders of the current time step (those forwarded to isNewLeader()) for the next time step.(package private) Cooperation
Returns the cooperation.Returns the desire map.(package private) GapAcceptance
Return the gap-acceptance.getLatestDesire
(Class<? extends Incentive> incentiveClass) Returns the latest desire from the specified incentive.(package private) Synchronization
Returns the synchronization.Returns the synchronization state.(package private) HeadwayGtu
getSyncVehicle
(PerceptionCollectable<HeadwayGtu, LaneBasedGtu> adjLeaders) Returns the gtu from the set that is the current sync vehicle, ornull
of there is no sync vehicle or it is not in the set.(package private) Tailgating
Return the tail gating.(package private) boolean
(package private) boolean
isNewLeader
(HeadwayGtu gtu) Checks if the given leader is a new leader.(package private) boolean
isSyncVehicle
(HeadwayGtu gtu) Returns whether the provided gtu is the gtu that is synchronized to.void
setHumanLongitudinalControl
(boolean humanLongitudinalControl) (package private) void
setSynchronizationState
(Synchronizable.State synchronizationState) Sets the synchronization state.(package private) void
setSyncVehicle
(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
- Synchronization; synchronizationcooperation
- Cooperation; cooperationgapAcceptance
- GapAcceptance; gap-acceptancetailgating
- Tailgating; tail gating
-
-
Method Details
-
isNewLeader
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
Remembers the gtu that is synchronized to.- Parameters:
gtu
- HeadwayGtu; gtu that is synchronized to
-
isSyncVehicle
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
Returns the gtu from the set that is the current sync vehicle, ornull
of 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
Returns the latest desire from the specified incentive.- Specified by:
getLatestDesire
in interfaceDesireBased
- Parameters:
incentiveClass
- Class<? extends Incentive>; incentive class- Returns:
- latest desire from the specified incentive
-
getDesireMap
Returns the desire map.- Returns:
- Map<Class<? extends Incentive>, Desire>; desire map
-
setSynchronizationState
Sets the synchronization state.- Parameters:
synchronizationState
- Synchronizable.State; synchronization step
-
getSynchronizationState
Returns the synchronization state.- Specified by:
getSynchronizationState
in interfaceSynchronizable
- Returns:
- State; synchronization state
-
isHumanLongitudinalControl
boolean isHumanLongitudinalControl()- Returns:
- humanLongitudinalControl.
-
setHumanLongitudinalControl
public void setHumanLongitudinalControl(boolean humanLongitudinalControl) - Parameters:
humanLongitudinalControl
- boolean; set humanLongitudinalControl.
-
toString
-