Class FlowStatistics<T>
java.lang.Object
com.amalgamasimulation.discreterate.flowstatistic.FlowStatistics<T>
- Type Parameters:
T- the type of the flow element.
Represents statistical data related to flow profiles for a collection of flow
elements.
- Author:
- Alexander Morozov
-
Constructor Summary
ConstructorsConstructorDescriptionFlowStatistics(List<Bunker<T>> bunkers) Constructs a FlowStatistics instance that calculates the collective statistics for the provided list of bunkers, i.e.FlowStatistics(List<Bunker<T>> bunkers, Predicate<T> inflowMaterialFilter, Predicate<T> outflowMaterialFilter) Constructs a FlowStatistics instance that calculates the collective statistics for the provided list of bunkers, with filtered material flows. -
Method Summary
Modifier and TypeMethodDescriptionReturns theFlowProfilethat contains inflow statistics for the tracked flow elements.inflowWithin(Interval interval) Calculates the incoming flow of the tracked flow elements within the specified timeInterval.doubleinflowWithin(T element, Interval interval) Calculates the incoming flow for a specified element within the given timeInterval.Returns theFlowProfilethat contains outflow statistics for the tracked flow elements.outflowWithin(Interval interval) Calculates the outgoing flow of the tracked flow elements within the specified timeInterval.doubleoutflowWithin(T element, Interval interval) Calculates the outgoing flow for a specified element within the given timeInterval.Returns theFlowProfilethat contains stock statistics for the tracked flow elements.
-
Constructor Details
-
FlowStatistics
Constructs a FlowStatistics instance that calculates the collective statistics for the provided list of bunkers, i.e. all specified bunkers are considered as a single bunker.- Parameters:
bunkers- a list ofBunkerinstances representing flow elements to be tracked for rate changes.
-
FlowStatistics
public FlowStatistics(List<Bunker<T>> bunkers, Predicate<T> inflowMaterialFilter, Predicate<T> outflowMaterialFilter) Constructs a FlowStatistics instance that calculates the collective statistics for the provided list of bunkers, with filtered material flows. The statistics are calculated considering all specified bunkers as a single bunker, but only including materials that pass the provided filters.- Parameters:
bunkers- a list ofBunkerinstances representing flow elements to be tracked for rate changesinflowMaterialFilter- a predicate that determines which materials should be included in inflow statistics (returns true to include)outflowMaterialFilter- a predicate that determines which materials should be included in outflow statistics (returns true to include)
-
-
Method Details
-
inflowProfile
Returns theFlowProfilethat contains inflow statistics for the tracked flow elements.- Returns:
- the
FlowProfileinstance representing the inflow statistics for the tracked flow elements
-
outflowProfile
Returns theFlowProfilethat contains outflow statistics for the tracked flow elements.- Returns:
- the
FlowProfileinstance representing the outflow statistics for the tracked flow elements
-
stockProfile
Returns theFlowProfilethat contains stock statistics for the tracked flow elements. FlowProfile contains the initial amount of material located in tracked flow elements before the creation of FlowStatistics.FlowStatistics does not take into account manual placement of materials in tracked flow elements using the
Bunker.addContents(Accumulator)andBunker.replaceContents(Accumulator)methods.- Returns:
- the
FlowProfileinstance representing the stock statistics for the tracked flow elements
-
inflowWithin
Calculates the incoming flow of the tracked flow elements within the specified timeInterval.- Parameters:
interval- theIntervaldefining the time span for which to calculate the flow- Returns:
- an
Accumulatorcontaining the flow values within the specified time interval
-
inflowWithin
Calculates the incoming flow for a specified element within the given timeInterval. -
outflowWithin
Calculates the outgoing flow of the tracked flow elements within the specified timeInterval.- Parameters:
interval- theIntervaldefining the time span for which to calculate the flow- Returns:
- an
Accumulatorcontaining the flow values within the specified time interval
-
outflowWithin
Calculates the outgoing flow for a specified element within the given timeInterval.
-