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,Identifiable
public class TrajectoryPlot extends AbstractSamplerPlot implements XYDataset
Plot of trajectories along a path.Copyright (c) 2013-2022 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 13 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 TrajectoryPlot(String caption, Duration updateInterval, OTSSimulatorInterface simulator, SamplerData<?> samplerData, GraphPath<KpiLaneDirection> path)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DomainOrdergetDomainOrder()GraphTypegetGraphType()Return the graph type for transceiver.intgetItemCount(int series)List<Boolean>getLaneVisible()Retrieve the lane visibility flags.LegendItemCollectiongetLegend()Retrieve the legend.intgetSeriesCount()Comparable<Integer>getSeriesKey(int series)StringgetStatusLabel(double domainValue, double rangeValue)Returns the status label when the mouse is over the given location.NumbergetX(int series, int item)doublegetXValue(int series, int item)NumbergetY(int series, int item)doublegetYValue(int series, int item)protected voidincreaseTime(Time time)Increase the simulated time span.intindexOf(Comparable seriesKey)StringtoString()-
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 Detail
-
TrajectoryPlot
public TrajectoryPlot(String caption, Duration updateInterval, OTSSimulatorInterface simulator, SamplerData<?> samplerData, GraphPath<KpiLaneDirection> path)
Constructor.- Parameters:
caption- String; captionupdateInterval- Duration; regular update interval (simulation time)simulator- OTSSimulatorInterface; simulatorsamplerData- SamplerData<?>; sampler datapath- GraphPath<KpiLaneDirection>; path
-
-
Method Detail
-
getGraphType
public GraphType getGraphType()
Return the graph type for transceiver.- Specified by:
getGraphTypein classAbstractPlot- Returns:
- GraphType; the graph type.
-
getStatusLabel
public String getStatusLabel(double domainValue, double rangeValue)
Returns the status label when the mouse is over the given location.- Specified by:
getStatusLabelin 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
protected void increaseTime(Time time)
Increase the simulated time span.- Specified by:
increaseTimein classAbstractPlot- Parameters:
time- Time; time to increase to
-
getSeriesCount
public int getSeriesCount()
- Specified by:
getSeriesCountin interfaceSeriesDataset
-
getSeriesKey
public Comparable<Integer> getSeriesKey(int series)
- Specified by:
getSeriesKeyin interfaceSeriesDataset
-
indexOf
public int indexOf(Comparable seriesKey)
- Specified by:
indexOfin interfaceSeriesDataset
-
getDomainOrder
public DomainOrder getDomainOrder()
- Specified by:
getDomainOrderin interfaceXYDataset
-
getItemCount
public int getItemCount(int series)
- Specified by:
getItemCountin interfaceXYDataset
-
getXValue
public double getXValue(int series, int item)
-
getYValue
public double getYValue(int series, int item)
-
getLegend
public LegendItemCollection getLegend()
Retrieve the legend.- Returns:
- LegendItemCollection; the legend
-
-