public final class Trajectory extends Object
Copyright (c) 2013-2016 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
Constructor and Description |
---|
Trajectory(GtuDataInterface gtu,
MetaData metaData,
Set<ExtendedDataType<?>> extendedData,
KpiLaneDirection kpiLaneDirection) |
Modifier and Type | Method and Description |
---|---|
void |
add(org.djunits.value.vdouble.scalar.Length position,
org.djunits.value.vdouble.scalar.Speed speed,
org.djunits.value.vdouble.scalar.Acceleration acceleration,
org.djunits.value.vdouble.scalar.Time time)
Adds values of position, speed, acceleration and time.
|
void |
add(org.djunits.value.vdouble.scalar.Length position,
org.djunits.value.vdouble.scalar.Speed speed,
org.djunits.value.vdouble.scalar.Acceleration acceleration,
org.djunits.value.vdouble.scalar.Time time,
GtuDataInterface gtu)
Adds values of position, speed, acceleration and time.
|
boolean |
contains(ExtendedDataType<?> extendedDataType) |
boolean |
contains(MetaDataType<?> metaDataType) |
boolean |
equals(Object obj) |
float[] |
getA() |
org.djunits.value.vfloat.vector.FloatAccelerationVector |
getAcceleration() |
<T> List<T> |
getExtendedData(ExtendedDataType<T> extendedDataType) |
String |
getGtuId() |
<T> T |
getMetaData(MetaDataType<T> metaDataType) |
org.djunits.value.vfloat.vector.FloatLengthVector |
getPosition() |
org.djunits.value.vfloat.vector.FloatSpeedVector |
getSpeed() |
float[] |
getT() |
org.djunits.value.vfloat.vector.FloatTimeVector |
getTime() |
org.djunits.value.vdouble.scalar.Duration |
getTotalDuration() |
org.djunits.value.vdouble.scalar.Length |
getTotalLength() |
float[] |
getV() |
float[] |
getX() |
int |
hashCode() |
int |
size() |
Trajectory |
subSet(org.djunits.value.vdouble.scalar.Length startPosition,
org.djunits.value.vdouble.scalar.Length endPosition)
Copies the trajectory but with a subset of the data.
|
Trajectory |
subSet(org.djunits.value.vdouble.scalar.Length startPosition,
org.djunits.value.vdouble.scalar.Length endPosition,
org.djunits.value.vdouble.scalar.Time startTime,
org.djunits.value.vdouble.scalar.Time endTime)
Copies the trajectory but with a subset of the data.
|
Trajectory |
subSet(org.djunits.value.vdouble.scalar.Time startTime,
org.djunits.value.vdouble.scalar.Time endTime)
Copies the trajectory but with a subset of the data.
|
String |
toString() |
public Trajectory(GtuDataInterface gtu, MetaData metaData, Set<ExtendedDataType<?>> extendedData, KpiLaneDirection kpiLaneDirection)
gtu
- GTU of this trajectory, only the id is stored.metaData
- meta dataextendedData
- types of extended datakpiLaneDirection
- direction of travelpublic void add(org.djunits.value.vdouble.scalar.Length position, org.djunits.value.vdouble.scalar.Speed speed, org.djunits.value.vdouble.scalar.Acceleration acceleration, org.djunits.value.vdouble.scalar.Time time)
position
- position is relative to the start of the lane in the direction of the design line, i.e. irrespective of
the travel direction, also when trajectories have been truncated at a position x > 0speed
- speedacceleration
- accelerationtime
- timepublic void add(org.djunits.value.vdouble.scalar.Length position, org.djunits.value.vdouble.scalar.Speed speed, org.djunits.value.vdouble.scalar.Acceleration acceleration, org.djunits.value.vdouble.scalar.Time time, GtuDataInterface gtu)
position
- position is relative to the start of the lane in the direction of the design line, i.e. irrespective of
the travel direction, also when trajectories have been truncated at a position x > 0speed
- speedacceleration
- accelerationtime
- timegtu
- gtu to add extended data forpublic int size()
public String getGtuId()
public float[] getX()
public float[] getV()
public float[] getA()
public float[] getT()
public org.djunits.value.vfloat.vector.FloatLengthVector getPosition()
public org.djunits.value.vfloat.vector.FloatSpeedVector getSpeed()
public org.djunits.value.vfloat.vector.FloatAccelerationVector getAcceleration()
public org.djunits.value.vfloat.vector.FloatTimeVector getTime()
public org.djunits.value.vdouble.scalar.Length getTotalLength()
IllegalStateException
- if trajectory is emptypublic org.djunits.value.vdouble.scalar.Duration getTotalDuration()
IllegalStateException
- if trajectory is emptypublic boolean contains(MetaDataType<?> metaDataType)
metaDataType
- meta data typepublic <T> T getMetaData(MetaDataType<T> metaDataType)
T
- class of meta datametaDataType
- meta data typepublic boolean contains(ExtendedDataType<?> extendedDataType)
extendedDataType
- extended data typepublic <T> List<T> getExtendedData(ExtendedDataType<T> extendedDataType) throws SamplingException
T
- value type of the extended data typeextendedDataType
- extended data type to returnSamplingException
- if the extended data type is not in the trajectorypublic Trajectory subSet(org.djunits.value.vdouble.scalar.Length startPosition, org.djunits.value.vdouble.scalar.Length endPosition)
startPosition
- start positionendPosition
- end positionNullPointerException
- if an input is nullIllegalArgumentException
- of minLength is smaller than maxLengthpublic Trajectory subSet(org.djunits.value.vdouble.scalar.Time startTime, org.djunits.value.vdouble.scalar.Time endTime)
startTime
- start timeendTime
- end timeNullPointerException
- if an input is nullIllegalArgumentException
- of minTime is smaller than maxTimepublic Trajectory subSet(org.djunits.value.vdouble.scalar.Length startPosition, org.djunits.value.vdouble.scalar.Length endPosition, org.djunits.value.vdouble.scalar.Time startTime, org.djunits.value.vdouble.scalar.Time endTime)
startPosition
- start positionendPosition
- end positionstartTime
- start timeendTime
- end timeNullPointerException
- if an input is nullIllegalArgumentException
- of minLength/Time is smaller than maxLength/TimeCopyright © 2014–2016 Delft University of Technology. All rights reserved.