Package org.opentrafficsim.draw.graphs
Class TrajectoryPlot
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.TrajectoryPlot
- All Implemented Interfaces:
Dataset
,SeriesDataset
,XYDataset
,org.opentrafficsim.base.Identifiable
Plot of trajectories along a path.
Copyright (c) 2013-2023 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
-
Field Summary
Fields inherited from class org.opentrafficsim.draw.graphs.AbstractPlot
DEFAULT_INITIAL_UPPER_TIME_BOUND, GRAPH_ADD_EVENT, GRAPH_REMOVE_EVENT
-
Constructor Summary
ConstructorsConstructorDescriptionTrajectoryPlot
(String caption, Duration updateInterval, org.opentrafficsim.core.dsol.OtsSimulatorInterface simulator, org.opentrafficsim.kpi.sampling.SamplerData<?> samplerData, GraphPath<? extends org.opentrafficsim.kpi.interfaces.LaneData> path) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionReturn the graph type for transceiver.int
getItemCount
(int series) Retrieve the lane visibility flags.Retrieve the legend.int
getSeriesKey
(int series) getStatusLabel
(double domainValue, double rangeValue) Returns the status label when the mouse is over the given location.getX
(int series, int item) double
getXValue
(int series, int item) getY
(int series, int item) double
getYValue
(int series, int item) protected void
increaseTime
(Time time) Increase the simulated time span.int
indexOf
(Comparable seriesKey) toString()
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, wait, wait, wait
Methods inherited from interface org.jfree.data.general.Dataset
addChangeListener, getGroup, removeChangeListener, setGroup
-
Constructor Details
-
TrajectoryPlot
public TrajectoryPlot(String caption, Duration updateInterval, org.opentrafficsim.core.dsol.OtsSimulatorInterface simulator, org.opentrafficsim.kpi.sampling.SamplerData<?> samplerData, GraphPath<? extends org.opentrafficsim.kpi.interfaces.LaneData> path) Constructor.- Parameters:
caption
- String; captionupdateInterval
- Duration; regular update interval (simulation time)simulator
- OtsSimulatorInterface; simulatorsamplerData
- SamplerData<?>; sampler datapath
- GraphPath<? extends LaneData>; path
-
-
Method Details
-
getGraphType
Return the graph type for transceiver.- Specified by:
getGraphType
in classAbstractPlot
- Returns:
- GraphType; the graph type.
-
getStatusLabel
Returns the status label when the mouse is over the given location.- Specified by:
getStatusLabel
in classAbstractPlot
- Parameters:
domainValue
- double; domain value (x-axis)rangeValue
- double; range value (y-axis)- Returns:
- String; status label when the mouse is over the given location
-
increaseTime
Increase the simulated time span.- Specified by:
increaseTime
in classAbstractPlot
- Parameters:
time
- Time; time to increase to
-
getSeriesCount
public int getSeriesCount()- Specified by:
getSeriesCount
in interfaceSeriesDataset
-
getSeriesKey
- Specified by:
getSeriesKey
in interfaceSeriesDataset
-
indexOf
- Specified by:
indexOf
in interfaceSeriesDataset
-
getDomainOrder
- Specified by:
getDomainOrder
in interfaceXYDataset
-
getItemCount
public int getItemCount(int series) - Specified by:
getItemCount
in interfaceXYDataset
-
getX
-
getXValue
public double getXValue(int series, int item) -
getY
-
getYValue
public double getYValue(int series, int item) -
toString
-
getLegend
Retrieve the legend.- Returns:
- LegendItemCollection; the legend
-
getLaneVisible
Retrieve the lane visibility flags.- Returns:
- List<Boolean>; the lane visibility flags
-