Class AbstractSamplerPlot

All Implemented Interfaces:
org.djutils.base.Identifiable, org.jfree.data.general.Dataset
Direct Known Subclasses:
AbstractContourPlot, TrajectoryPlot

public abstract class AbstractSamplerPlot extends AbstractSpaceTimePlot
Super class for plots that use sampler data. Sub classes may obtain trajectories using getTrajectories(), or alternatively maintain some other -possibly more efficient- connection to the sampler. This class also connects the plot to a path, consisting of a list of lanes. Start distance along the path for each lane is provided to sub classes using getStartDistance(LaneData). Total length is obtained using getEndLocation().

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
  • Constructor Details

    • AbstractSamplerPlot

      public AbstractSamplerPlot(String caption, org.djunits.value.vdouble.scalar.Duration updateInterval, PlotScheduler scheduler, SamplerData<?> samplerData, GraphPath<? extends LaneData<?>> path, org.djunits.value.vdouble.scalar.Duration delay)
      Constructor.
      Parameters:
      caption - String; caption
      updateInterval - Duration; regular update interval (simulation time)
      scheduler - PlotScheduler; scheduler.
      samplerData - SamplerData<?>; sampler data
      path - GraphPath<? extends LaneData>; path
      delay - Duration; amount of time that chart runs behind simulation to prevent gaps in the charted data
  • Method Details

    • getTrajectories

      protected List<TrajectoryGroup<?>> getTrajectories(int series)
      Returns all trajectories for the series, in order of the path.
      Parameters:
      series - int; series number
      Returns:
      List<TrajectoryGroup>; the trajectories
    • getPath

      public final GraphPath<? extends LaneData<?>> getPath()
      Returns the path.
      Returns:
      GraphPath<? extends LaneData>; the path
    • getEndLocation

      protected final org.djunits.value.vdouble.scalar.Length getEndLocation()
      Returns the total path length.
      Specified by:
      getEndLocation in class AbstractSpaceTimePlot
      Returns:
      Length; total path length
    • getSamplerData

      protected final SamplerData<?> getSamplerData()
      Returns the sampler data.
      Returns:
      SamplerData<?>; sampler.