H - headway typeL - lane based object typepublic abstract class LaneBasedObjectIterable<H extends Headway,L extends LaneBasedObject> extends AbstractPerceptionIterable<H,L,Boolean>
Copyright (c) 2013-2019 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
AbstractPerceptionIterable.EntryAbstractPerceptionReiterable.PerceptionIterator, AbstractPerceptionReiterable.PrimaryIteratorEntryPerceptionCollectable.Intermediate<I>, PerceptionCollectable.PerceptionAccumulator<U,I>, PerceptionCollectable.PerceptionCollector<C,U,I>, PerceptionCollectable.PerceptionFinalizer<C,I>, PerceptionCollectable.UnderlyingDistance<U>| Constructor and Description |
|---|
LaneBasedObjectIterable(LaneBasedGTU perceivingGtu,
Class<L> clazz,
LaneRecord<?> root,
Length initialPosition,
boolean downstream,
Length maxDistance,
RelativePosition relativePosition,
Route route)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected Length |
getDistance(L object,
LaneRecord<?> record,
Length position)
Returns the distance to the object.
|
protected AbstractPerceptionIterable.Entry |
getNext(LaneRecord<?> record,
Length position,
Boolean counter)
Returns the next object(s) on the lane represented by the record.
|
String |
toString() |
getDx, isDownstream, primaryIteratorcollect, first, getGtu, isEmpty, iterator, perceive, underlying, underlyingWithDistanceclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcollectforEach, spliteratorpublic LaneBasedObjectIterable(LaneBasedGTU perceivingGtu, Class<L> clazz, LaneRecord<?> root, Length initialPosition, boolean downstream, Length maxDistance, RelativePosition relativePosition, Route route)
perceivingGtu - LaneBasedGTU; perceiving GTUclazz - Class<L>; class of lane based objects to returnroot - LaneRecord<?>; root recordinitialPosition - Length; initial positiondownstream - boolean; downstreammaxDistance - Length; max distance to searchrelativePosition - RelativePosition; relative positionroute - Route; route of the GTU, may be nullprotected AbstractPerceptionIterable.Entry getNext(LaneRecord<?> record, Length position, Boolean counter)
null for
the first object(s). For following object(s) it is whatever value is given with the previous output Entry. Hence,
this method maintains its own counting system.getNext in class AbstractPerceptionIterable<H extends Headway,L extends LaneBasedObject,Boolean>record - LaneRecord<?>; record representing the lane and directionposition - Length; position to look beyondcounter - C; counternull if noneprotected final Length getDistance(L object, LaneRecord<?> record, Length position)
Entry returned
by getNext. The two methods need to be consistent with each other.getDistance in class AbstractPerceptionIterable<H extends Headway,L extends LaneBasedObject,Boolean>object - U; underlying objectrecord - LaneRecord<?>; record representing the lane and directionposition - Length; position of the object on the laneCopyright © 2014–2019 Delft University of Technology. All rights reserved.