Package org.opentrafficsim.draw.graphs
Interface FundamentalDiagram.FdSource
-
- Enclosing class:
- FundamentalDiagram
public static interface FundamentalDiagram.FdSource
Data source for a fundamental diagram.Copyright (c) 2013-2020 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.- Version:
- $Revision$, $LastChangedDate$, by $Author$, initial version 16 okt. 2018
- Author:
- Alexander Verbraeck, Peter Knoppers, Wouter Schakel
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description void
addFundamentalDiagram(FundamentalDiagram fundamentalDiagram)
Add fundamental diagram.void
clearFundamentalDiagrams()
Clears all connected fundamental diagrams.Duration
getAggregationPeriod()
The aggregation period.Duration
getDelay()
Return the delay for graph updates so future influencing events have occurred, e.d.double
getDensity(int series, int item)
Return the SI density value of item in series.ImmutableSet<FundamentalDiagram>
getDiagrams()
Returns the diagrams.double
getFlow(int series, int item)
Return the SI flow value of item in series.int
getItemCount(int series)
Returns the number of items in the series.java.lang.String
getName(int series)
Returns a name of the series.int
getNumberOfSeries()
Returns the number of series (i.e.default double[]
getPossibleAggregationPeriods()
Returns the possible intervals.default int[]
getPossibleUpdateFrequencies()
Returns the possible frequencies, as a factor on 1 / 'aggregation interval'.double
getSpeed(int series, int item)
Return the SI speed value of item in series.Duration
getUpdateInterval()
The update interval.void
increaseTime(Time time)
Increase the time span.boolean
isAggregate()
Returns whether this source aggregates lanes.void
recalculate(Time time)
Recalculates the data after the aggregation or update time was changed.void
setAggregateName(java.lang.String aggregateName)
Sets the name of the series when aggregated, e.g.void
setAggregationPeriod(Duration period)
Changes the aggregation period.void
setUpdateInterval(Duration interval, Time time)
Changes the update interval.
-
-
-
Method Detail
-
getPossibleAggregationPeriods
default double[] getPossibleAggregationPeriods()
Returns the possible intervals.- Returns:
- double[]; possible intervals
-
getPossibleUpdateFrequencies
default int[] getPossibleUpdateFrequencies()
Returns the possible frequencies, as a factor on 1 / 'aggregation interval'.- Returns:
- int[]; possible frequencies
-
addFundamentalDiagram
void addFundamentalDiagram(FundamentalDiagram fundamentalDiagram)
Add fundamental diagram. Used to notify diagrams when data has changed.- Parameters:
fundamentalDiagram
- FundamentalDiagram; fundamental diagram
-
clearFundamentalDiagrams
void clearFundamentalDiagrams()
Clears all connected fundamental diagrams.
-
getDiagrams
ImmutableSet<FundamentalDiagram> getDiagrams()
Returns the diagrams.- Returns:
- ImmutableSet<FundamentalDiagram> diagrams
-
getUpdateInterval
Duration getUpdateInterval()
The update interval.- Returns:
- Duration; update interval
-
setUpdateInterval
void setUpdateInterval(Duration interval, Time time)
Changes the update interval.- Parameters:
interval
- Duration; update intervaltime
- Time; time until which data has to be recalculated
-
getAggregationPeriod
Duration getAggregationPeriod()
The aggregation period.- Returns:
- Duration; aggregation period
-
setAggregationPeriod
void setAggregationPeriod(Duration period)
Changes the aggregation period.- Parameters:
period
- Duration; aggregation period
-
recalculate
void recalculate(Time time)
Recalculates the data after the aggregation or update time was changed.- Parameters:
time
- Time; time up to which recalculation is required
-
getDelay
Duration getDelay()
Return the delay for graph updates so future influencing events have occurred, e.d. GTU move's.- Returns:
- Duration; graph delay
-
increaseTime
void increaseTime(Time time)
Increase the time span.- Parameters:
time
- Time; time to increase to
-
getNumberOfSeries
int getNumberOfSeries()
Returns the number of series (i.e. lanes or 1 for aggregated).- Returns:
- int; number of series
-
getName
java.lang.String getName(int series)
Returns a name of the series.- Parameters:
series
- int; series number- Returns:
- String; name of the series
-
getItemCount
int getItemCount(int series)
Returns the number of items in the series.- Parameters:
series
- int; series number- Returns:
- int; number of items in the series
-
getFlow
double getFlow(int series, int item)
Return the SI flow value of item in series.- Parameters:
series
- int; series numberitem
- int; item number in the series- Returns:
- double; 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
- int; series numberitem
- int; item number in the series- Returns:
- double; 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
- int; series numberitem
- int; item number in the series- Returns:
- double; SI speed value of item in series
-
isAggregate
boolean isAggregate()
Returns whether this source aggregates lanes.- Returns:
- boolean; whether this source aggregates lanes
-
setAggregateName
void setAggregateName(java.lang.String aggregateName)
Sets the name of the series when aggregated, e.g. for legend. Default is "Aggregate".- Parameters:
aggregateName
- String; name of the series when aggregated
-
-