Class AnticipationTrafficPerception

java.lang.Object
org.opentrafficsim.core.gtu.perception.AbstractPerceptionCategory<LaneBasedGtu,LanePerception>
org.opentrafficsim.road.gtu.perception.categories.AnticipationTrafficPerception
All Implemented Interfaces:
Type<AbstractPerceptionCategory<LaneBasedGtu,LanePerception>>, PerceptionCategory<LaneBasedGtu,LanePerception>, LaneBasedPerceptionCategory, TrafficPerception

public class AnticipationTrafficPerception extends AbstractPerceptionCategory<LaneBasedGtu,LanePerception> implements TrafficPerception
Traffic perception using neighbors perception. Speed is anticipated as in the LMRS. Density is simply distance of the farthest leader divided by the number of leaders.

Copyright (c) 2013-2026 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
  • Field Details

  • Constructor Details

    • AnticipationTrafficPerception

      public AnticipationTrafficPerception(LanePerception perception)
      Constructor.
      Parameters:
      perception - perception
  • Method Details

    • getSpeed

      public org.djunits.value.vdouble.scalar.Speed getSpeed(RelativeLane lane, org.djunits.value.vdouble.scalar.Speed desiredSpeed) throws ParameterException
      Description copied from interface: TrafficPerception
      Returns the perceived speed on the given lane.
      Specified by:
      getSpeed in interface TrafficPerception
      Parameters:
      lane - lane
      desiredSpeed - desired speed, to which the speed will tend when there is fewer traffic
      Returns:
      Speed perceived speed on the given lane
      Throws:
      ParameterException - on parameter exception
    • getDensity

      public org.djunits.value.vdouble.scalar.LinearDensity getDensity(RelativeLane lane)
      Description copied from interface: TrafficPerception
      Returns the perceived density on the given lane.
      Specified by:
      getDensity in interface TrafficPerception
      Parameters:
      lane - lane
      Returns:
      LinearDensity perceived density on the given lane
    • toString

      public String toString()
      Overrides:
      toString in class Object