Class PathFlowUpdateConsumer<T extends NetworkFlowUpdateData>
- java.lang.Object
-
- org.goplanit.assignment.ltm.sltm.consumer.PathFlowUpdateConsumer<T>
-
- All Implemented Interfaces:
TriConsumer<OdZone,OdZone,Double>
- Direct Known Subclasses:
PathLinkFlowUpdateConsumer
,PathTurnFlowUpdateConsumer
public abstract class PathFlowUpdateConsumer<T extends NetworkFlowUpdateData> extends Object implements TriConsumer<OdZone,OdZone,Double>
Base Consumer to apply during path based flow update for each combination of origin, destination, and demandDerived implementation can apply different changes to each of the (turn/link) flows on the known paths by providing different single flow update implementations that are applied to each turn on each path with non-zero demand.
- Author:
- markr
-
-
Field Summary
Fields Modifier and Type Field Description protected T
dataConfig
data and configuration used for a flow update by derived classes
-
Constructor Summary
Constructors Constructor Description PathFlowUpdateConsumer(T dataConfig, OdPaths odPaths)
Constructor
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
accept(OdZone origin, OdZone destination, Double odDemand)
Update the turn flows for the path of the given origin,destination,demand combinationprotected abstract void
applyPathFinalSegmentFlowUpdate(EdgeSegment lastEdgeSegment, double acceptedPathFlowRate)
Apply the flow to a final path segment (and update link sending flow if required) which has no outgoing edge segment on the turnprotected abstract double
applySingleFlowUpdate(EdgeSegment prevSegment, EdgeSegment currentSegment, double turnSendingFlowPcuH)
Apply the flow to the turn (and update link sending flow if required)
-
-
-
Field Detail
-
dataConfig
protected T extends NetworkFlowUpdateData dataConfig
data and configuration used for a flow update by derived classes
-
-
Method Detail
-
applySingleFlowUpdate
protected abstract double applySingleFlowUpdate(EdgeSegment prevSegment, EdgeSegment currentSegment, double turnSendingFlowPcuH)
Apply the flow to the turn (and update link sending flow if required)- Parameters:
prevSegment
- of turncurrentSegment
- of turnturnSendingFlowPcuH
- sending flow rate of turn- Returns:
- accepted flow rate of turn after applying link acceptance factor
-
applyPathFinalSegmentFlowUpdate
protected abstract void applyPathFinalSegmentFlowUpdate(EdgeSegment lastEdgeSegment, double acceptedPathFlowRate)
Apply the flow to a final path segment (and update link sending flow if required) which has no outgoing edge segment on the turn- Parameters:
lastEdgeSegment
- of pathacceptedPathFlowRate
- sending flow rate on last edge segment
-
accept
public void accept(OdZone origin, OdZone destination, Double odDemand)
Update the turn flows for the path of the given origin,destination,demand combination- Specified by:
accept
in interfaceTriConsumer<OdZone,OdZone,Double>
- Parameters:
origin
- first object to be processeddestination
- second object to be processedodDemand
- third object to be processed
-
-