Class 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 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 turn
        toSegment - of turn
        turnSendingFlow - to update
      • addTurnSendingFlow

        public void addTurnSendingFlow​(EdgeSegment fromSegment,
                                       EdgeSegment toSegment,
                                       double turnSendingFlow)
        Add turn sending flow for a given turn
        Parameters:
        fromSegment - of turn
        toSegment - of turn
        turnSendingFlow - to update
      • removeTurn

        public void removeTurn​(EdgeSegment fromEdgeSegment,
                               EdgeSegment toEdgeSegment)
        Remove the turn
        Parameters:
        fromEdgeSegment - of turn
        toEdgeSegment - of turn
      • getTurnSendingFlowPcuH

        public double getTurnSendingFlowPcuH​(EdgeSegment fromSegment,
                                             EdgeSegment toSegment)
        Get the turn sending flow for a given turn
        Parameters:
        fromSegment - from of turn
        toSegment - 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 turn
        toSegment - 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 for
        toSegment - of turn to collect splitting rate for
        Returns:
        splitting rate, when turn is not present or not used, zero is returned