G
- gtu type datapublic class ContourDataSource<G extends GtuDataInterface> extends Object
By default the source contains traveled time and traveled distance per cell.
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.
Modifier and Type | Class and Description |
---|---|
static interface |
ContourDataSource.ContourDataType<Z extends Number,I>
Interface for data types of which a contour plot can be made.
|
static class |
ContourDataSource.Dimension
Enum to refer to either the distance or time axis.
|
Modifier and Type | Field and Description |
---|---|
protected static Time |
DEFAULT_LOWER_TIME_BOUND
Initial lower bound for the time scale.
|
protected static double[] |
DEFAULT_SPACE_GRANULARITIES
Space granularity values.
|
protected static int |
DEFAULT_SPACE_GRANULARITY_INDEX
Index of the initial space granularity.
|
protected static double[] |
DEFAULT_TIME_GRANULARITIES
Time granularity values.
|
protected static int |
DEFAULT_TIME_GRANULARITY_INDEX
Index of the initial time granularity.
|
Constructor and Description |
---|
ContourDataSource(Sampler<G> sampler,
Duration delay,
GraphPath<KpiLaneDirection> path,
double[] spaceGranularity,
int initSpaceIndex,
double[] timeGranularity,
int initTimeIndex,
Time start,
Time initialEnd)
Constructor for non-default input.
|
ContourDataSource(Sampler<G> sampler,
GraphPath<KpiLaneDirection> path)
Constructor using default granularities.
|
Modifier and Type | Method and Description |
---|---|
double |
get(int item,
ContourDataSource.ContourDataType<?,?> contourDataType)
Returns data of the given
ContourDataType for a specific item. |
Sampler<G> |
getSampler()
Returns the sampler for an
AbstractContourPlot using this ContourDataSource . |
double |
getSpeed(int item)
Returns the speed of the cell pertaining to plot item.
|
double |
getTotalDistance(int item)
Returns the total distance traveled in the cell pertaining to plot item.
|
double |
getTotalTime(int item)
Returns the total time traveled in the cell pertaining to plot item.
|
String |
toString() |
protected static final double[] DEFAULT_SPACE_GRANULARITIES
protected static final int DEFAULT_SPACE_GRANULARITY_INDEX
protected static final double[] DEFAULT_TIME_GRANULARITIES
protected static final int DEFAULT_TIME_GRANULARITY_INDEX
protected static final Time DEFAULT_LOWER_TIME_BOUND
public ContourDataSource(Sampler<G> sampler, GraphPath<KpiLaneDirection> path)
sampler
- Sampler<G>; samplerpath
- GraphPath<KpiLaneDirection>; pathpublic ContourDataSource(Sampler<G> sampler, Duration delay, GraphPath<KpiLaneDirection> path, double[] spaceGranularity, int initSpaceIndex, double[] timeGranularity, int initTimeIndex, Time start, Time initialEnd)
sampler
- Sampler<G>; samplerdelay
- Duration; delay so critical future events have occurred, e.g. GTU's next move's to extend trajectoriespath
- GraphPath<KpiLaneDirection>; pathspaceGranularity
- double[]; granularity options for space dimensioninitSpaceIndex
- int; initial selected space granularitytimeGranularity
- double[]; granularity options for time dimensioninitTimeIndex
- int; initial selected time granularitystart
- Time; start timeinitialEnd
- Time; initial end time of plots, will be expanded if simulation time exceeds itpublic final Sampler<G> getSampler()
AbstractContourPlot
using this ContourDataSource
.public double getSpeed(int item)
item
- int; plot itempublic double getTotalDistance(int item)
item
- int; plot itempublic double getTotalTime(int item)
item
- int; plot itempublic double get(int item, ContourDataSource.ContourDataType<?,?> contourDataType)
ContourDataType
for a specific item.item
- int; plot itemcontourDataType
- ContourDataType<?, ?>; contour data typeContourDataType
for a specific itemCopyright © 2014–2019 Delft University of Technology. All rights reserved.