Package org.opentrafficsim.draw.graphs
Interface FundamentalDiagram.FdSource
- All Known Implementing Classes:
FundamentalDiagram.AbstractFdSource
- Enclosing class:
- FundamentalDiagram
public static interface FundamentalDiagram.FdSource
Data source for a fundamental diagram.
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
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddFundamentalDiagram(FundamentalDiagram fundamentalDiagram) Add fundamental diagram.voidClears all connected fundamental diagrams.org.djunits.value.vdouble.scalar.DurationThe aggregation period.org.djunits.value.vdouble.scalar.DurationgetDelay()Return the delay for graph updates so future influencing events have occurred, e.d.doublegetDensity(int series, int item) Return the SI density value of item in series.org.djutils.immutablecollections.ImmutableSet<FundamentalDiagram>Returns the diagrams.doublegetFlow(int series, int item) Return the SI flow value of item in series.intgetItemCount(int series) Returns the number of items in the series.getName(int series) Returns a name of the series.intReturns the number of series (i.e. lanes or 1 for aggregated).default double[]Returns the possible intervals.default int[]Returns the possible frequencies, as a factor on 1 / 'aggregation interval'.doublegetSpeed(int series, int item) Return the SI speed value of item in series.org.djunits.value.vdouble.scalar.DurationThe update interval.voidincreaseTime(org.djunits.value.vdouble.scalar.Time time) Increase the time span.booleanReturns whether this source aggregates lanes.voidrecalculate(org.djunits.value.vdouble.scalar.Time time) Recalculates the data after the aggregation or update time was changed.voidsetAggregateName(String aggregateName) Sets the name of the series when aggregated, e.g. for legend.voidsetAggregationPeriod(org.djunits.value.vdouble.scalar.Duration period) Changes the aggregation period.voidsetUpdateInterval(org.djunits.value.vdouble.scalar.Duration interval, org.djunits.value.vdouble.scalar.Time time) Changes the update interval.
-
Method Details
-
getPossibleAggregationPeriods
default double[] getPossibleAggregationPeriods()Returns the possible intervals.- Returns:
- possible intervals
-
getPossibleUpdateFrequencies
default int[] getPossibleUpdateFrequencies()Returns the possible frequencies, as a factor on 1 / 'aggregation interval'.- Returns:
- possible frequencies
-
addFundamentalDiagram
Add fundamental diagram. Used to notify diagrams when data has changed.- Parameters:
fundamentalDiagram- fundamental diagram
-
clearFundamentalDiagrams
void clearFundamentalDiagrams()Clears all connected fundamental diagrams. -
getDiagrams
org.djutils.immutablecollections.ImmutableSet<FundamentalDiagram> getDiagrams()Returns the diagrams.- Returns:
- ImmutableSet<FundamentalDiagram> diagrams
-
getUpdateInterval
org.djunits.value.vdouble.scalar.Duration getUpdateInterval()The update interval.- Returns:
- update interval
-
setUpdateInterval
void setUpdateInterval(org.djunits.value.vdouble.scalar.Duration interval, org.djunits.value.vdouble.scalar.Time time) Changes the update interval.- Parameters:
interval- update intervaltime- time until which data has to be recalculated
-
getAggregationPeriod
org.djunits.value.vdouble.scalar.Duration getAggregationPeriod()The aggregation period.- Returns:
- aggregation period
-
setAggregationPeriod
void setAggregationPeriod(org.djunits.value.vdouble.scalar.Duration period) Changes the aggregation period.- Parameters:
period- aggregation period
-
recalculate
void recalculate(org.djunits.value.vdouble.scalar.Time time) Recalculates the data after the aggregation or update time was changed.- Parameters:
time- time up to which recalculation is required
-
getDelay
org.djunits.value.vdouble.scalar.Duration getDelay()Return the delay for graph updates so future influencing events have occurred, e.d. GTU move's.- Returns:
- graph delay
-
increaseTime
void increaseTime(org.djunits.value.vdouble.scalar.Time time) Increase the time span.- Parameters:
time- time to increase to
-
getNumberOfSeries
int getNumberOfSeries()Returns the number of series (i.e. lanes or 1 for aggregated).- Returns:
- number of series
-
getName
Returns a name of the series.- Parameters:
series- series number- Returns:
- name of the series
-
getItemCount
int getItemCount(int series) Returns the number of items in the series.- Parameters:
series- series number- Returns:
- number of items in the series
-
getFlow
double getFlow(int series, int item) Return the SI flow value of item in series.- Parameters:
series- series numberitem- item number in the series- Returns:
- SI flow value of item in series
-
getDensity
double getDensity(int series, int item) Return the SI density value of item in series.- Parameters:
series- series numberitem- item number in the series- Returns:
- SI density value of item in series
-
getSpeed
double getSpeed(int series, int item) Return the SI speed value of item in series.- Parameters:
series- series numberitem- item number in the series- Returns:
- SI speed value of item in series
-
isAggregate
boolean isAggregate()Returns whether this source aggregates lanes.- Returns:
- whether this source aggregates lanes
-
setAggregateName
Sets the name of the series when aggregated, e.g. for legend. Default is "Aggregate".- Parameters:
aggregateName- name of the series when aggregated
-