Class MultiLanePerceptionIterable<H extends Headway,U>

java.lang.Object
org.opentrafficsim.road.gtu.lane.perception.AbstractPerceptionReiterable<H,U>
org.opentrafficsim.road.gtu.lane.perception.MultiLanePerceptionIterable<H,U>
Type Parameters:
H - headway type
U - underlying headway type
All Implemented Interfaces:
Iterable<H>, PerceptionCollectable<H,U>, PerceptionIterable<H>

public class MultiLanePerceptionIterable<H extends Headway,U> extends AbstractPerceptionReiterable<H,U>
Iterable class to search over multiple lanes.

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

    • MultiLanePerceptionIterable

      public MultiLanePerceptionIterable(LaneBasedGtu perceivingGtu)
      Constructor.
      Parameters:
      perceivingGtu - LaneBasedGtu; perceiving GTU
  • Method Details

    • addIterable

      public void addIterable(RelativeLane lane, AbstractPerceptionReiterable<H,U> iterable)
      Adds an iterable for a lane.
      Parameters:
      lane - RelativeLane; lane
      iterable - AbstractPerceptionReiterable<H, U>; iterable
    • primaryIterator

      Returns the primary iterator. This method is called once by AbstractPerceptionReiterable.
      Specified by:
      primaryIterator in class AbstractPerceptionReiterable<H extends Headway,U>
      Returns:
      Iterator; primary iterator
    • perceive

      public H perceive(LaneBasedGtu perceivingGtu, U object, org.djunits.value.vdouble.scalar.Length distance) throws GtuException, org.opentrafficsim.base.parameters.ParameterException
      Returns a perceived version of the underlying object.
      Specified by:
      perceive in class AbstractPerceptionReiterable<H extends Headway,U>
      Parameters:
      perceivingGtu - LaneBasedGtu; perceiving GTU
      object - U; underlying object
      distance - Length; distance to the object
      Returns:
      H; perceived version of the underlying object
      Throws:
      GtuException - on exception
      org.opentrafficsim.base.parameters.ParameterException - on invalid parameter value or missing parameter