Package org.goplanit.assignment.ltm.sltm
Class BushTurnData
- java.lang.Object
-
- org.goplanit.assignment.ltm.sltm.BushTurnData
-
- All Implemented Interfaces:
Cloneable
public class BushTurnData extends Object implements Cloneable
Track the turn based data of a bush.For now we only track turn sending flows to minimise bookkeeping and memory usage, splitting rates are deduced from the turn sending flows when needed.
- Author:
- markr
-
-
Constructor Summary
Constructors Constructor Description BushTurnData(BushTurnData bushTurnData)
copy constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addTurnSendingFlow(EdgeSegment fromSegment, EdgeSegment toSegment, double turnSendingFlow)
Add turn sending flow for a given turnBushTurnData
clone()
boolean
containsTurnSendingFlow(EdgeSegment fromSegment, EdgeSegment toSegment)
Check if entry existsdouble
getSplittingRate(EdgeSegment fromSegment, EdgeSegment toSegment)
Collect the splitting rates for a given link segment.double[]
getSplittingRates(EdgeSegment fromSegment)
Collect the splitting rates for a given link segment.double
getTotalSendingFlowPcuH(EdgeSegment fromSegment)
Total sending flows s_a from given segmentdouble
getTurnSendingFlowPcuH(EdgeSegment fromSegment, EdgeSegment toSegment)
Get the turn sending flow for a given turnvoid
removeTurn(EdgeSegment fromEdgeSegment, EdgeSegment toEdgeSegment)
Remove the turnvoid
updateTurnSendingFlow(EdgeSegment fromSegment, EdgeSegment toSegment, double turnSendingFlow)
Update the turn sending flow for a given turn
-
-
-
Constructor Detail
-
BushTurnData
public BushTurnData(BushTurnData bushTurnData)
copy constructor- Parameters:
bushTurnData
- to copy
-
-
Method Detail
-
updateTurnSendingFlow
public void updateTurnSendingFlow(EdgeSegment fromSegment, EdgeSegment toSegment, double turnSendingFlow)
Update the turn sending flow for a given turn- Parameters:
fromSegment
- of turntoSegment
- of turnturnSendingFlow
- to update
-
addTurnSendingFlow
public void addTurnSendingFlow(EdgeSegment fromSegment, EdgeSegment toSegment, double turnSendingFlow)
Add turn sending flow for a given turn- Parameters:
fromSegment
- of turntoSegment
- of turnturnSendingFlow
- to update
-
removeTurn
public void removeTurn(EdgeSegment fromEdgeSegment, EdgeSegment toEdgeSegment)
Remove the turn- Parameters:
fromEdgeSegment
- of turntoEdgeSegment
- of turn
-
getTurnSendingFlowPcuH
public double getTurnSendingFlowPcuH(EdgeSegment fromSegment, EdgeSegment toSegment)
Get the turn sending flow for a given turn- Parameters:
fromSegment
- from of turntoSegment
- to of turn- Returns:
- turn sending flow, 0 if not present
-
getTotalSendingFlowPcuH
public double getTotalSendingFlowPcuH(EdgeSegment fromSegment)
Total sending flows s_a from given segment- Parameters:
fromSegment
- to use- Returns:
- sending flow s_a
-
containsTurnSendingFlow
public boolean containsTurnSendingFlow(EdgeSegment fromSegment, EdgeSegment toSegment)
Check if entry exists- Parameters:
fromSegment
- of turntoSegment
- of turn- Returns:
- true when present, false otherwise
-
getSplittingRates
public double[] getSplittingRates(EdgeSegment fromSegment)
Collect the splitting rates for a given link segment. Splitting rates are based on the current turn sending flows s_ab.- Parameters:
fromSegment
- to collect bush splitting rates for- Returns:
- splitting rates in primitive array in order of which one iterates over the outgoing edge segments of the downstream from segment vertex
-
getSplittingRate
public double getSplittingRate(EdgeSegment fromSegment, EdgeSegment toSegment)
Collect the splitting rates for a given link segment. Splitting rates are based on the current turn sending flows s_ab.- Parameters:
fromSegment
- of turn to collect splitting rate fortoSegment
- of turn to collect splitting rate for- Returns:
- splitting rate, when turn is not present or not used, zero is returned
-
clone
public BushTurnData clone()
-
-