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-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
  • Constructor Details

    • LmrsData

      public LmrsData(Synchronization synchronization, Cooperation cooperation, GapAcceptance gapAcceptance, Tailgating tailgating)
      Parameters:
      synchronization - Synchronization; synchronization
      cooperation - Cooperation; cooperation
      gapAcceptance - GapAcceptance; gap-acceptance
      tailgating - Tailgating; tail gating
  • Method Details

    • 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

      Returns the gtu from the set that is the current sync vehicle, or null 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

      public Desire getLatestDesire(Class<? extends Incentive> incentiveClass)
      Returns the latest desire from the specified incentive.
      Specified by:
      getLatestDesire in interface DesireBased
      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:
      getSynchronizationState in interface Synchronizable
      Returns:
      State; synchronization state
    • isHumanLongitudinalControl

      boolean isHumanLongitudinalControl()
      Returns:
      humanLongitudinalControl.
    • setHumanLongitudinalControl

      public void setHumanLongitudinalControl(boolean humanLongitudinalControl)
      Parameters:
      humanLongitudinalControl - boolean; set humanLongitudinalControl.
    • toString

      public String toString()
      Overrides:
      toString in class Object