Class TrajectoryPlot

All Implemented Interfaces:
Dataset, SeriesDataset, XYDataset, org.opentrafficsim.base.Identifiable

public class TrajectoryPlot extends AbstractSamplerPlot implements XYDataset
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
  • 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; caption
      updateInterval - Duration; regular update interval (simulation time)
      simulator - OtsSimulatorInterface; simulator
      samplerData - SamplerData<?>; sampler data
      path - GraphPath<? extends LaneData>; path
  • Method Details

    • getGraphType

      public GraphType getGraphType()
      Return the graph type for transceiver.
      Specified by:
      getGraphType in class AbstractPlot
      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:
      getStatusLabel in class AbstractPlot
      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:
      increaseTime in class AbstractPlot
      Parameters:
      time - Time; time to increase to
    • getSeriesCount

      public int getSeriesCount()
      Specified by:
      getSeriesCount in interface SeriesDataset
    • getSeriesKey

      public Comparable<Integer> getSeriesKey(int series)
      Specified by:
      getSeriesKey in interface SeriesDataset
    • indexOf

      public int indexOf(Comparable seriesKey)
      Specified by:
      indexOf in interface SeriesDataset
    • getDomainOrder

      public DomainOrder getDomainOrder()
      Specified by:
      getDomainOrder in interface XYDataset
    • getItemCount

      public int getItemCount(int series)
      Specified by:
      getItemCount in interface XYDataset
    • getX

      public Number getX(int series, int item)
      Specified by:
      getX in interface XYDataset
    • getXValue

      public double getXValue(int series, int item)
      Specified by:
      getXValue in interface XYDataset
    • getY

      public Number getY(int series, int item)
      Specified by:
      getY in interface XYDataset
    • getYValue

      public double getYValue(int series, int item)
      Specified by:
      getYValue in interface XYDataset
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getLegend

      public LegendItemCollection getLegend()
      Retrieve the legend.
      Returns:
      LegendItemCollection; the legend
    • getLaneVisible

      public List<Boolean> getLaneVisible()
      Retrieve the lane visibility flags.
      Returns:
      List<Boolean>; the lane visibility flags