class TrajectoryPlot.Trajectory extends Object
Copyright (c) 2013-2015 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
See for project information www.simulation.tudelft.nl.
The OpenTrafficSim project is distributed under the following BSD-style license:
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
following conditions are met:
Constructor and Description |
---|
Trajectory(Object id)
Construct a Trajectory.
|
Modifier and Type | Method and Description |
---|---|
void |
addSegment(AbstractLaneBasedGTU car,
Lane lane,
double positionOffset)
Add a trajectory segment and update the currentEndTime and currentEndPosition.
|
org.djunits.value.vdouble.scalar.Length.Rel |
getCurrentEndPosition()
Retrieve the current end position of this Trajectory.
|
org.djunits.value.vdouble.scalar.Time.Abs |
getCurrentEndTime()
Retrieve the current end time of this Trajectory.
|
double |
getDistance(int item) |
Object |
getId()
Retrieve the id of this Trajectory.
|
double |
getTime(int item) |
int |
size()
Retrieve the number of samples in this Trajectory.
|
public Trajectory(Object id)
id
- Object; Id of the new Trajectorypublic final org.djunits.value.vdouble.scalar.Time.Abs getCurrentEndTime()
public final org.djunits.value.vdouble.scalar.Length.Rel getCurrentEndPosition()
public final Object getId()
public final void addSegment(AbstractLaneBasedGTU car, Lane lane, double positionOffset) throws org.opentrafficsim.core.network.NetworkException
car
- AbstractLaneBasedGTU; the GTU whose currently committed trajectory segment must be addedlane
- Lane; the Lane that the positionOffset is valid forpositionOffset
- double; offset needed to convert the position in the current Lane to a position on the
trajectoryorg.opentrafficsim.core.network.NetworkException
- when car is not on lane anymorepublic int size()
public double getTime(int item)
item
- Integer; the sample numberpublic double getDistance(int item)
item
- Integer; the sample numberCopyright © 2014–2015 Delft University of Technology. All rights reserved.