public class FundamentalDiagram extends AbstractBoundedPlot implements XYDataset
Copyright (c) 2013-2019 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
| Modifier and Type | Class and Description |
|---|---|
static interface |
FundamentalDiagram.FdSource
Data source for a fundamental diagram.
|
static class |
FundamentalDiagram.Quantity
Quantity enum defining density, flow and speed.
|
| Modifier and Type | Field and Description |
|---|---|
static double[] |
DEFAULT_PERIODS
Aggregation periods.
|
static int[] |
DEFAULT_UPDATE_FREQUENCIES
Update frequencies (n * 1/period).
|
DEFAULT_INITIAL_UPPER_TIME_BOUND, GRAPH_ADD_EVENT, GRAPH_REMOVE_EVENT| Constructor and Description |
|---|
FundamentalDiagram(String caption,
FundamentalDiagram.Quantity domainQuantity,
FundamentalDiagram.Quantity rangeQuantity,
OTSSimulatorInterface simulator,
FundamentalDiagram.FdSource source)
Constructor.
|
FundamentalDiagram(String caption,
FundamentalDiagram.Quantity domainQuantity,
FundamentalDiagram.Quantity rangeQuantity,
OTSSimulatorInterface simulator,
Sampler<?> sampler,
GraphCrossSection<KpiLaneDirection> crossSection,
boolean aggregateLanes,
Duration aggregationTime,
boolean harmonic)
Constructor using a sampler as source.
|
FundamentalDiagram(String caption,
FundamentalDiagram.Quantity domainQuantity,
FundamentalDiagram.Quantity rangeQuantity,
OTSSimulatorInterface simulator,
Sampler<?> sampler,
GraphPath<KpiLaneDirection> path,
boolean aggregateLanes,
Duration aggregationTime)
Constructor using a sampler as source.
|
| Modifier and Type | Method and Description |
|---|---|
DomainOrder |
getDomainOrder() |
FundamentalDiagram.Quantity |
getDomainQuantity()
Return the domain quantity.
|
GraphType |
getGraphType()
Return the graph type for transceiver.
|
int |
getItemCount(int series) |
List<Boolean> |
getLaneVisible()
Return the list of lane visibility flags.
|
LegendItemCollection |
getLegend()
Retrievee the legend of this FundamentalDiagram.
|
FundamentalDiagram.Quantity |
getOtherQuantity()
Get the other (non domain; vertical axis) quantity.
|
FundamentalDiagram.Quantity |
getRangeQuantity()
Get the range quantity.
|
int |
getSeriesCount() |
Comparable<String> |
getSeriesKey(int series) |
FundamentalDiagram.FdSource |
getSource()
Get the data source.
|
String |
getStatusLabel(double domainValue,
double rangeValue)
Returns the status label when the mouse is over the given location.
|
String |
getTimeInfo()
Retrieve the time info.
|
Number |
getX(int series,
int item) |
double |
getXValue(int series,
int item) |
Number |
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) |
void |
setDomainQuantity(FundamentalDiagram.Quantity domainQuantity)
Set the domain quantity.
|
void |
setOtherQuantity(FundamentalDiagram.Quantity otherQuantity)
Set the other (non domain; vertical axis) quantity.
|
void |
setRangeQuantity(FundamentalDiagram.Quantity rangeQuantity)
Set the range quantity.
|
void |
setTimeInfo(String timeInfo)
Set the time info.
|
static FundamentalDiagram.FdSource |
sourceFromSampler(Sampler<?> sampler,
GraphCrossSection<KpiLaneDirection> crossSection,
boolean aggregateLanes,
Duration aggregationTime,
boolean harmonic)
Creates a
Source from a sampler and positions. |
static FundamentalDiagram.FdSource |
sourceFromSampler(Sampler<?> sampler,
GraphPath<KpiLaneDirection> path,
boolean aggregateLanes,
Duration aggregationTime)
Creates a
Source from a sampler and positions. |
String |
toString() |
setAutoBoundDomain, setAutoBoundRange, setChart, setLowerDomainBound, setLowerRangeBound, setUpperDomainBound, setUpperRangeBoundaddChangeListener, encodeAsPng, getCaption, getChart, getGroup, getId, getSimulator, getUpdateTime, notifyPlotChange, removeChangeListener, setGroup, setUpdateInterval, updateclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddChangeListener, getGroup, removeChangeListener, setGrouppublic static final double[] DEFAULT_PERIODS
public static final int[] DEFAULT_UPDATE_FREQUENCIES
public FundamentalDiagram(String caption, FundamentalDiagram.Quantity domainQuantity, FundamentalDiagram.Quantity rangeQuantity, OTSSimulatorInterface simulator, FundamentalDiagram.FdSource source)
caption - String; captiondomainQuantity - Quantity; initial quantity on the domain axisrangeQuantity - Quantity; initial quantity on the range axissimulator - OTSSimulatorInterface; simulatorsource - FdSource; source providing the datapublic FundamentalDiagram(String caption, FundamentalDiagram.Quantity domainQuantity, FundamentalDiagram.Quantity rangeQuantity, OTSSimulatorInterface simulator, Sampler<?> sampler, GraphCrossSection<KpiLaneDirection> crossSection, boolean aggregateLanes, Duration aggregationTime, boolean harmonic)
caption - String; captiondomainQuantity - Quantity; initial quantity on the domain axisrangeQuantity - Quantity; initial quantity on the range axissimulator - OTSSimulatorInterface; simulatorsampler - Sampler<?>; samplercrossSection - GraphCrossSection<KpiLaneDirection>; lanesaggregateLanes - boolean; whether to aggregate the positionsaggregationTime - Duration; aggregation time (and update time)harmonic - boolean; harmonic meanpublic FundamentalDiagram(String caption, FundamentalDiagram.Quantity domainQuantity, FundamentalDiagram.Quantity rangeQuantity, OTSSimulatorInterface simulator, Sampler<?> sampler, GraphPath<KpiLaneDirection> path, boolean aggregateLanes, Duration aggregationTime)
caption - String; captiondomainQuantity - Quantity; initial quantity on the domain axisrangeQuantity - Quantity; initial quantity on the range axissimulator - OTSSimulatorInterface; simulatorsampler - Sampler<?>; samplerpath - GraphPath<KpiLaneDirection>; lanesaggregateLanes - boolean; whether to aggregate the positionsaggregationTime - Duration; aggregation time (and update time)protected void increaseTime(Time time)
increaseTime in class AbstractPlottime - Time; time to increase topublic int getSeriesCount()
getSeriesCount in interface SeriesDatasetpublic Comparable<String> getSeriesKey(int series)
getSeriesKey in interface SeriesDatasetpublic int indexOf(Comparable seriesKey)
indexOf in interface SeriesDatasetpublic DomainOrder getDomainOrder()
getDomainOrder in interface XYDatasetpublic int getItemCount(int series)
getItemCount in interface XYDatasetpublic double getXValue(int series,
int item)
public double getYValue(int series,
int item)
public GraphType getGraphType()
getGraphType in class AbstractPlotpublic String getStatusLabel(double domainValue, double rangeValue)
getStatusLabel in class AbstractPlotdomainValue - double; domain value (x-axis)rangeValue - double; range value (y-axis)public static FundamentalDiagram.FdSource sourceFromSampler(Sampler<?> sampler, GraphCrossSection<KpiLaneDirection> crossSection, boolean aggregateLanes, Duration aggregationTime, boolean harmonic)
Source from a sampler and positions.sampler - Sampler<?>; samplercrossSection - GraphCrossSection<KpiLaneDirection>; cross sectionaggregateLanes - boolean; whether to aggregate the positionsaggregationTime - Duration; aggregation time (and update time)harmonic - boolean; harmonic meanpublic static FundamentalDiagram.FdSource sourceFromSampler(Sampler<?> sampler, GraphPath<KpiLaneDirection> path, boolean aggregateLanes, Duration aggregationTime)
Source from a sampler and positions.sampler - Sampler<?>; samplerpath - GraphPath<KpiLaneDirection>; cross sectionaggregateLanes - boolean; whether to aggregate the positionsaggregationTime - Duration; aggregation time (and update time)public FundamentalDiagram.FdSource getSource()
public LegendItemCollection getLegend()
public List<Boolean> getLaneVisible()
public FundamentalDiagram.Quantity getDomainQuantity()
public void setDomainQuantity(FundamentalDiagram.Quantity domainQuantity)
domainQuantity - Quantity; the new domain quantitypublic FundamentalDiagram.Quantity getOtherQuantity()
public void setOtherQuantity(FundamentalDiagram.Quantity otherQuantity)
otherQuantity - Quantity; the quantity for the vertical axispublic FundamentalDiagram.Quantity getRangeQuantity()
public void setRangeQuantity(FundamentalDiagram.Quantity rangeQuantity)
rangeQuantity - Quantity; the new range quantitypublic String getTimeInfo()
public void setTimeInfo(String timeInfo)
timeInfo - String; the new time infoCopyright © 2014–2019 Delft University of Technology. All rights reserved.