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:
java.lang.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.PrimaryIteratorEntryNested 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
Modifier and Type Method Description voidaddIterable(RelativeLane lane, AbstractPerceptionReiterable<H,U> iterable)Adds an iterable for a lane.Hperceive(LaneBasedGTU perceivingGtu, U object, Length distance)Returns a perceived version of the underlying object.java.util.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, underlyingWithDistanceMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.opentrafficsim.road.gtu.lane.perception.PerceptionCollectable
collect
-
Constructor Details
-
MultiLanePerceptionIterable
Constructor.- Parameters:
perceivingGtu- LaneBasedGTU; perceiving GTU
-
-
Method Details
-
addIterable
Adds an iterable for a lane.- Parameters:
lane- RelativeLane; laneiterable- AbstractPerceptionReiterable<H, U>; iterable
-
primaryIterator
Returns the primary iterator. This method is called once by AbstractPerceptionReiterable.- Specified by:
primaryIteratorin classAbstractPerceptionReiterable<H extends Headway,U>- Returns:
- Iterator; primary iterator
-
perceive
public H perceive(LaneBasedGTU perceivingGtu, U object, Length distance) throws GTUException, ParameterExceptionReturns a perceived version of the underlying object.- Specified by:
perceivein 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
-