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 typeU
- 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-2020 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.- Version:
- $Revision$, $LastChangedDate$, by $Author$, initial version 20 feb. 2018
- Author:
- Alexander Verbraeck, Peter Knoppers, Wouter Schakel
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.opentrafficsim.road.gtu.lane.perception.AbstractPerceptionReiterable
AbstractPerceptionReiterable.PerceptionIterator, AbstractPerceptionReiterable.PrimaryIteratorEntry
-
Nested classes/interfaces inherited from interface org.opentrafficsim.road.gtu.lane.perception.PerceptionCollectable
PerceptionCollectable.Intermediate<I>, PerceptionCollectable.PerceptionAccumulator<U,I>, PerceptionCollectable.PerceptionCollector<C,U,I>, PerceptionCollectable.PerceptionFinalizer<C,I>, PerceptionCollectable.UnderlyingDistance<U>
-
-
Constructor Summary
Constructors Constructor Description MultiLanePerceptionIterable(LaneBasedGTU perceivingGtu)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addIterable(RelativeLane lane, AbstractPerceptionReiterable<H,U> iterable)
Adds an iterable for a lane.H
perceive(LaneBasedGTU perceivingGtu, U object, Length distance)
Returns a perceived version of the underlying object.Iterator<AbstractPerceptionReiterable.PrimaryIteratorEntry>
primaryIterator()
Returns the primary iterator.-
Methods inherited from class org.opentrafficsim.road.gtu.lane.perception.AbstractPerceptionReiterable
collect, first, getGtu, isEmpty, iterator, underlying, underlyingWithDistance
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Methods inherited from interface org.opentrafficsim.road.gtu.lane.perception.PerceptionCollectable
collect
-
-
-
-
Constructor Detail
-
MultiLanePerceptionIterable
public MultiLanePerceptionIterable(LaneBasedGTU perceivingGtu)
Constructor.- Parameters:
perceivingGtu
- LaneBasedGTU; perceiving GTU
-
-
Method Detail
-
addIterable
public void addIterable(RelativeLane lane, AbstractPerceptionReiterable<H,U> iterable)
Adds an iterable for a lane.- Parameters:
lane
- RelativeLane; laneiterable
- AbstractPerceptionReiterable<H, U>; iterable
-
primaryIterator
public Iterator<AbstractPerceptionReiterable.PrimaryIteratorEntry> primaryIterator()
Returns the primary iterator. This method is called once by AbstractPerceptionReiterable.- Specified by:
primaryIterator
in classAbstractPerceptionReiterable<H extends Headway,U>
- Returns:
- Iterator; primary iterator
-
perceive
public H perceive(LaneBasedGTU perceivingGtu, U object, Length distance) throws GTUException, ParameterException
Returns a perceived version of the underlying object.- Specified by:
perceive
in classAbstractPerceptionReiterable<H extends Headway,U>
- Parameters:
perceivingGtu
- LaneBasedGTU; perceiving GTUobject
- U; underlying objectdistance
- Length; distance to the object- Returns:
- H; perceived version of the underlying object
- Throws:
GTUException
- on exceptionParameterException
- on invalid parameter value or missing parameter
-
-