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:
org.djutils.base.Identifiable,org.jfree.data.general.Dataset,org.jfree.data.general.SeriesDataset,org.jfree.data.xy.XYDataset
Plot of trajectories along a path.
Copyright (c) 2013-2024 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, org.djunits.value.vdouble.scalar.Duration updateInterval, PlotScheduler scheduler, SamplerData<?> samplerData, GraphPath<? extends LaneData<?>> path) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionorg.jfree.data.DomainOrderReturn the graph type for transceiver.intgetItemCount(int series) Retrieve the lane visibility flags.org.jfree.chart.LegendItemCollectionRetrieve the legend.intgetSeriesKey(int series) getStatusLabel(double domainValue, double rangeValue) Returns the status label when the mouse is over the given location.getX(int series, int item) doublegetXValue(int series, int item) getY(int series, int item) doublegetYValue(int series, int item) protected voidincreaseTime(org.djunits.value.vdouble.scalar.Time time) Increase the simulated time span.intindexOf(Comparable seriesKey) toString()Methods inherited from class org.opentrafficsim.draw.graphs.AbstractSamplerPlot
getEndLocation, getPath, getSamplerData, getTrajectoriesMethods inherited from class org.opentrafficsim.draw.graphs.AbstractSpaceTimePlot
setAutoBoundDomain, setAutoBoundRange, setChart, update, updateFixedDomainRangeMethods inherited from class org.opentrafficsim.draw.graphs.AbstractBoundedPlot
setLowerDomainBound, setLowerRangeBound, setUpperDomainBound, setUpperRangeBoundMethods inherited from class org.opentrafficsim.draw.graphs.AbstractPlot
addChangeListener, encodeAsPng, getCaption, getChart, getGroup, getId, getUpdateTime, notifyPlotChange, removeChangeListener, setGroup, setUpdateIntervalMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.jfree.data.general.Dataset
addChangeListener, getGroup, removeChangeListener, setGroup
-
Constructor Details
-
TrajectoryPlot
public TrajectoryPlot(String caption, org.djunits.value.vdouble.scalar.Duration updateInterval, PlotScheduler scheduler, SamplerData<?> samplerData, GraphPath<? extends LaneData<?>> path) Constructor.- Parameters:
caption- String; captionupdateInterval- Duration; regular update interval (simulation time)scheduler- PlotScheduler; scheduler.samplerData- SamplerData<?>; sampler datapath- GraphPath<? extends LaneData>; path
-
-
Method Details
-
getGraphType
Return the graph type for transceiver.- Specified by:
getGraphTypein classAbstractPlot- Returns:
- GraphType; the graph type.
-
getStatusLabel
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(org.djunits.value.vdouble.scalar.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 interfaceorg.jfree.data.general.SeriesDataset
-
getSeriesKey
- Specified by:
getSeriesKeyin interfaceorg.jfree.data.general.SeriesDataset
-
indexOf
- Specified by:
indexOfin interfaceorg.jfree.data.general.SeriesDataset
-
getDomainOrder
public org.jfree.data.DomainOrder getDomainOrder()- Specified by:
getDomainOrderin interfaceorg.jfree.data.xy.XYDataset
-
getItemCount
public int getItemCount(int series) - Specified by:
getItemCountin interfaceorg.jfree.data.xy.XYDataset
-
getX
- Specified by:
getXin interfaceorg.jfree.data.xy.XYDataset
-
getXValue
public double getXValue(int series, int item) - Specified by:
getXValuein interfaceorg.jfree.data.xy.XYDataset
-
getY
- Specified by:
getYin interfaceorg.jfree.data.xy.XYDataset
-
getYValue
public double getYValue(int series, int item) - Specified by:
getYValuein interfaceorg.jfree.data.xy.XYDataset
-
toString
-
getLegend
public org.jfree.chart.LegendItemCollection getLegend()Retrieve the legend.- Returns:
- LegendItemCollection; the legend
-
getLaneVisible
Retrieve the lane visibility flags.- Returns:
- List<Boolean>; the lane visibility flags
-