Class NavigatingIterable<T,L extends LaneRecordInterface<L>>
java.lang.Object
org.opentrafficsim.road.gtu.lane.perception.structure.NavigatingIterable<T,L>
- Type Parameters:
T
- type of objectL
- type of lane structure record
- All Implemented Interfaces:
Iterable<NavigatingIterable.Entry<T>>
public class NavigatingIterable<T,L extends LaneRecordInterface<L>>
extends Object
implements Iterable<NavigatingIterable.Entry<T>>
Iterable over entries (with distance and merge distance stored) of objects. The iterable uses a navigator, lister and
distancer.
- navigator; returns a collection of lane records to continue a search from a covered lane record.
- lister; returns a list of objects from a lane record. The list must be ordered in the search direction (close to
far). Objects of any type may be returned as the navigating iterator will check whether objects are of type
T
. In order to only include objects in the correct range, the lister must account for the start distance of the record, and any possible relative position of a GTU. - distancer; returns distance of an object. The distancer must account for any possible relative position of the GTUs.
Copyright (c) 2024-2024 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
- Author:
- Wouter Schakel
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final record
Container for a perceived object with the distance towards it and the distance until the road of the object and the road of the perceiving GTU merge. -
Constructor Summary
ConstructorsConstructorDescriptionNavigatingIterable
(Class<T> clazz, org.djunits.value.vdouble.scalar.Length range, Collection<L> start, Function<L, Collection<L>> navigator, Function<L, List<?>> lister, BiFunction<T, L, org.djunits.value.vdouble.scalar.Length> distancer) Constructor. -
Method Summary
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
-
Constructor Details
-
NavigatingIterable
public NavigatingIterable(Class<T> clazz, org.djunits.value.vdouble.scalar.Length range, Collection<L> start, Function<L, Collection<L>> navigator, Function<L, List<?>> lister, BiFunction<T, L, org.djunits.value.vdouble.scalar.Length> distancer) Constructor.- Parameters:
clazz
- class of lane-based object type.range
- range within which objects are included.start
- start collection of lane records.navigator
- navigator.lister
- obtains ordered list of objects from lane.distancer
- returns distance of object.
-
-
Method Details