H - headway typeL - lane based object typepublic abstract class LaneBasedObjectIterable<H extends Headway,L extends LaneBasedObject> extends AbstractPerceptionIterable<H,L,Void>
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>| Constructor and Description |
|---|
LaneBasedObjectIterable(LaneBasedGTU perceivingGtu,
Class<L> clazz,
LaneRecord<?> root,
Length initialPosition,
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,
Void counter)
Returns the next object(s) on the lane represented by the record.
|
String |
toString() |
getDx, primaryIteratorcollect, first, getGtu, isEmpty, iterator, perceive, underlyingclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcollectforEach, spliteratorpublic LaneBasedObjectIterable(LaneBasedGTU perceivingGtu, Class<L> clazz, LaneRecord<?> root, Length initialPosition, Length maxDistance, RelativePosition relativePosition, Route route)
perceivingGtu - LaneBasedGTU; perceiving GTUclazz - Class<L>; class of lane based objects to returnroot - LaneRecord<?>; root recordinitialPosition - Length; initial positionmaxDistance - Length; max distance to searchrelativePosition - RelativePosition; relative positionroute - Route; route of the GTU, may be nullprotected AbstractPerceptionIterable.Entry getNext(LaneRecord<?> record, Length position, Void counter)
getNext in class AbstractPerceptionIterable<H extends Headway,L extends LaneBasedObject,Void>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,Void>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.