Class ContourPlotDelay
- java.lang.Object
-
- org.opentrafficsim.draw.graphs.AbstractPlot
-
- org.opentrafficsim.draw.graphs.AbstractBoundedPlot
-
- org.opentrafficsim.draw.graphs.AbstractSpaceTimePlot
-
- org.opentrafficsim.draw.graphs.AbstractSamplerPlot
-
- org.opentrafficsim.draw.graphs.AbstractContourPlot<Duration>
-
- org.opentrafficsim.draw.graphs.road.ContourPlotDelay
-
- All Implemented Interfaces:
java.awt.event.ActionListener
,java.util.EventListener
,Dataset
,SeriesDataset
,XYDataset
,XYZDataset
,Identifiable
public class ContourPlotDelay extends AbstractContourPlot<Duration>
Contour plot for delay.A note on the unit "/km". This unit is derived by measuring the total delay over a cell in space-time, which gives an SI value in [s]. With varying granularity, the value needs to be normalized to space-time. Hence, the value is divided by the length of the cell [m], and divided by the duration of the cell [s]. This gives a unit of [s/s/m] = [1/m]. This means that a traffic state represented by a value of D/km, gives a total amount of delay equal to D * x * t, where x * t is the size of the cell, and the resulting value is in the same unit as t. So if D = 50/km, then measuring this state over 2km and during 3 hours gives 50 * 2 * 3 = 300h of delay.
Copyright (c) 2013-2020 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.- Version:
- $Revision$, $LastChangedDate$, by $Author$, initial version 10 okt. 2018
- Author:
- Alexander Verbraeck, Peter Knoppers, Wouter Schakel
-
-
Field Summary
-
Fields inherited from class org.opentrafficsim.draw.graphs.AbstractPlot
DEFAULT_INITIAL_UPPER_TIME_BOUND, GRAPH_ADD_EVENT, GRAPH_REMOVE_EVENT
-
-
Constructor Summary
Constructors Constructor Description ContourPlotDelay(java.lang.String caption, OTSSimulatorInterface simulator, ContourDataSource<GtuData> dataPool)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ContourDataSource.ContourDataType<Duration,Duration>
getContourDataType()
Returns the contour data type for use in aContourDataSource
.GraphType
getGraphType()
Return the graph type for transceiver.protected double
getValue(int item, double cellLength, double cellSpan)
Obtain value for cell from the data pool.protected double
scale(double si)
Scale the value from SI to the desired unit for users.-
Methods inherited from class org.opentrafficsim.draw.graphs.AbstractContourPlot
actionPerformed, getBlockRenderer, getDataPool, getDomainOrder, getItemCount, getRangeBinCount, getSeriesCount, getSeriesKey, getSpaceGranularity, getStatusLabel, getTimeGranularity, getX, getXValue, getY, getYValue, getZ, getZValue, increaseTime, indexOf, setInterpolation, setSpaceGranularity, setTimeGranularity
-
Methods inherited from class org.opentrafficsim.draw.graphs.AbstractSamplerPlot
getEndLocation, getPath, getSamplerData, getTrajectories
-
Methods inherited from class org.opentrafficsim.draw.graphs.AbstractSpaceTimePlot
setAutoBoundDomain, setAutoBoundRange, setChart, update, updateFixedDomainRange
-
Methods inherited from class org.opentrafficsim.draw.graphs.AbstractBoundedPlot
setLowerDomainBound, setLowerRangeBound, setUpperDomainBound, setUpperRangeBound
-
Methods inherited from class org.opentrafficsim.draw.graphs.AbstractPlot
addChangeListener, encodeAsPng, getCaption, getChart, getGroup, getId, getSimulator, getUpdateTime, notifyPlotChange, removeChangeListener, setGroup, setUpdateInterval
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.jfree.data.general.Dataset
addChangeListener, getGroup, removeChangeListener, setGroup
-
-
-
-
Constructor Detail
-
ContourPlotDelay
public ContourPlotDelay(java.lang.String caption, OTSSimulatorInterface simulator, ContourDataSource<GtuData> dataPool)
Constructor. In case this plot is created live, the sampler of the sample data in the data source needs to have the extended data typeReferenceSpeed.INSTANCE
registered.- Parameters:
caption
- String; captionsimulator
- OTSSimulatorInterface; simulatordataPool
- ContourDataSource<GtuData>; data pool
-
-
Method Detail
-
getGraphType
public GraphType getGraphType()
Return the graph type for transceiver.- Specified by:
getGraphType
in classAbstractPlot
- Returns:
- GraphType; the graph type.
-
scale
protected double scale(double si)
Scale the value from SI to the desired unit for users.- Specified by:
scale
in classAbstractContourPlot<Duration>
- Parameters:
si
- double; SI value- Returns:
- double; scaled value
-
getValue
protected double getValue(int item, double cellLength, double cellSpan)
Obtain value for cell from the data pool.- Specified by:
getValue
in classAbstractContourPlot<Duration>
- Parameters:
item
- int; item numbercellLength
- double; cell lengthcellSpan
- double; cell duration- Returns:
- double; value for cell from the data pool
-
getContourDataType
protected ContourDataSource.ContourDataType<Duration,Duration> getContourDataType()
Returns the contour data type for use in aContourDataSource
.- Specified by:
getContourDataType
in classAbstractContourPlot<Duration>
- Returns:
- CountorDataType; contour data type
-
-