Package org.opentrafficsim.kpi.sampling
Class TrajectoryGroup<G extends GtuData>
java.lang.Object
org.opentrafficsim.kpi.sampling.TrajectoryGroup<G>
- Type Parameters:
G
- gtu data type
- All Implemented Interfaces:
Iterable<Trajectory<G>>
Contains all trajectories pertaining to a certain space-time region.
Copyright (c) 2013-2024 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
- Author:
- Alexander Verbraeck, Peter Knoppers, Wouter Schakel
-
Constructor Summary
ConstructorDescriptionTrajectoryGroup
(org.djunits.value.vdouble.scalar.Time startTime, org.djunits.value.vdouble.scalar.Length startPosition, org.djunits.value.vdouble.scalar.Length endPosition, LaneData<?> lane) TrajectoryGroup
(org.djunits.value.vdouble.scalar.Time startTime, LaneData<?> lane) Constructor without length specification. -
Method Summary
Modifier and TypeMethodDescriptionfinal void
addTrajectory
(Trajectory<G> trajectory) Add trajectory.final boolean
contains
(Trajectory<?> trajectory) Whether thisTrajectoryGroup
holds the given trajectory.final boolean
final LaneData<?>
getLane()
Returns the lane.final org.djunits.value.vdouble.scalar.Length
final org.djunits.value.vdouble.scalar.Time
final List<Trajectory<G>>
Returns a list of trajectories.final TrajectoryGroup<G>
getTrajectoryGroup
(org.djunits.value.vdouble.scalar.Length x0, org.djunits.value.vdouble.scalar.Length x1) Returns trajectory group between two locations.final TrajectoryGroup<G>
getTrajectoryGroup
(org.djunits.value.vdouble.scalar.Length x0, org.djunits.value.vdouble.scalar.Length x1, org.djunits.value.vdouble.scalar.Time t0, org.djunits.value.vdouble.scalar.Time t1) Returns trajectory group between two locations and between two times.final TrajectoryGroup<G>
getTrajectoryGroup
(org.djunits.value.vdouble.scalar.Time t0, org.djunits.value.vdouble.scalar.Time t1) Returns trajectory group between two times.final int
hashCode()
iterator()
final int
size()
Returns the number of trajectories in this group.final String
toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
TrajectoryGroup
Constructor without length specification. The complete lane will be used.- Parameters:
startTime
- Time; start time of trajectorieslane
- LaneData<?>; lane
-
TrajectoryGroup
public TrajectoryGroup(org.djunits.value.vdouble.scalar.Time startTime, org.djunits.value.vdouble.scalar.Length startPosition, org.djunits.value.vdouble.scalar.Length endPosition, LaneData<?> lane) - Parameters:
startTime
- Time; start time of trajectory groupstartPosition
- Length; start positionendPosition
- Length; end positionlane
- LaneData<?>; the lane
-
-
Method Details
-
addTrajectory
Add trajectory.- Parameters:
trajectory
- Trajectory<G>; trajectory to add
-
getStartTime
public final org.djunits.value.vdouble.scalar.Time getStartTime()- Returns:
- startTime.
-
getLength
public final org.djunits.value.vdouble.scalar.Length getLength()- Returns:
- length.
-
contains
Whether thisTrajectoryGroup
holds the given trajectory. Note that this is false if the given trajectory is derived from a trajectory in thisTrajectoryGroup
.- Parameters:
trajectory
- Trajectory<?>; trajectory- Returns:
- whether this
TrajectoryGroup
holds the given trajectory.
-
size
public final int size()Returns the number of trajectories in this group.- Returns:
- number of trajectories in this group
-
getTrajectories
Returns a list of trajectories.- Returns:
- list of trajectories
-
getTrajectoryGroup
public final TrajectoryGroup<G> getTrajectoryGroup(org.djunits.value.vdouble.scalar.Length x0, org.djunits.value.vdouble.scalar.Length x1) Returns trajectory group between two locations.- Parameters:
x0
- Length; start lengthx1
- Length; end length- Returns:
- list of trajectories
-
getTrajectoryGroup
public final TrajectoryGroup<G> getTrajectoryGroup(org.djunits.value.vdouble.scalar.Time t0, org.djunits.value.vdouble.scalar.Time t1) Returns trajectory group between two times.- Parameters:
t0
- Time; start timet1
- Time; end time- Returns:
- list of trajectories
-
getTrajectoryGroup
public final TrajectoryGroup<G> getTrajectoryGroup(org.djunits.value.vdouble.scalar.Length x0, org.djunits.value.vdouble.scalar.Length x1, org.djunits.value.vdouble.scalar.Time t0, org.djunits.value.vdouble.scalar.Time t1) Returns trajectory group between two locations and between two times.- Parameters:
x0
- Length; start lengthx1
- Length; end lengtht0
- Time; start timet1
- Time; end time- Returns:
- list of trajectories
-
getLane
Returns the lane.- Returns:
- lane
-
hashCode
public final int hashCode() -
equals
-
toString
-
iterator
-