Class PasFlowShiftExecutor

    • Field Detail

      • EPSILON

        protected static final double EPSILON
        local epsilon used in flow shifting
        See Also:
        Constant Field Values
      • PAS_MIN_S2_FLOW_THRESHOLD

        protected static final double PAS_MIN_S2_FLOW_THRESHOLD
        whenever a PAS S2 alternative's flow drops below this threshold for a given bush, we allow the flow shift to move all remaining flow towards the S1 segment across all entry segments and unregister the bush for this PAS as it is no longer deemed a true alternative.
        See Also:
        Constant Field Values
      • pas

        protected final Pas pas
        to operate on
      • totalEntrySegmentS1S2Flow

        protected Map<EdgeSegment,​Pair<Double,​Double>> totalEntrySegmentS1S2Flow
        S1 and S2 sending flows along (entire) alternative for a given entry segment
      • usedCongestedEntryEdgeSegments

        protected final Set<EdgeSegment> usedCongestedEntryEdgeSegments
      • pasMergeVertexNumExitSegments

        protected final int pasMergeVertexNumExitSegments
        store locally as it is costly-ish to compute
    • Constructor Detail

      • PasFlowShiftExecutor

        protected PasFlowShiftExecutor​(Pas pas,
                                       StaticLtmSettings settings)
        Constructor
        Parameters:
        pas - to use
        settings - to use
    • Method Detail

      • activatePasS2RemovalIf

        protected void activatePasS2RemovalIf​(boolean flag)
        activate if flag is true
        Parameters:
        flag - to determine whether or not to activate
      • isPasS2RemovalAllowed

        protected boolean isPasS2RemovalAllowed()
      • executeBushFlowShift

        protected abstract void executeBushFlowShift​(RootedLabelledBush bush,
                                                     EdgeSegment entrySegment,
                                                     double bushEntrySegmentFlowShift,
                                                     double[] flowAcceptanceFactors)
        Perform the flow shift for a given bush. Delegate to concrete class implementation
        Parameters:
        bush - to perform shift for
        entrySegment - entry segment at hand to apply flow shift for
        bushEntrySegmentFlowShift - the absolute shift to apply for the given PAS-bush-entrysegment combination
        flowAcceptanceFactors - to use
      • determineEntrySegmentFlowShift

        protected double determineEntrySegmentFlowShift​(EdgeSegment entrySegment,
                                                        Mode theMode,
                                                        AbstractPhysicalCost physicalCost,
                                                        AbstractVirtualCost virtualCost,
                                                        StaticLtmLoadingBushBase<?> networkLoading)
        For the given PAS-entrysegment determine the flow shift to apply from the high cost to the low cost segment. Depending on the state of the segments we utilise their derivatives of travel time towards flow to determine the optimal shift. In case one or both segments are uncongested, or the congestion occurs on the entry segment while the cost on the PAS is already equal, we propose to shift as much flow as would yield an equal distribution between the alternatives (maximising entropy) in order to obtain a unique solution under equal cost. would expect the segment to transition to congestion.
        Parameters:
        entrySegment - to use
        theMode - to use
        physicalCost - to use
        virtualCost - to use
        networkLoading - to use
        Returns:
        amount of flow to shift
      • initialise

        public void initialise()
        Initialise by determining the desired flows along each subpath (on the network level)
      • run

        public boolean run​(Mode theMode,
                           AbstractPhysicalCost physicalCost,
                           AbstractVirtualCost virtualCost,
                           StaticLtmLoadingBushBase<?> networkLoading,
                           double factor)
        We account for the fact that per bush different incoming links to the PAS might be used so each incoming link that is used and that is congested should be the basis for the flow shift instead of the first congested one within the PAS. This is currently not accounted for + if an incoming link is congested, then it has the same alpha for both alternatives BUT the most restricting one might be linked to one of those. If so then we should shift towards the other! This does not exist yet. If neither is the most restricting then revert to situation where we shift as if uncongested as it has no impact. So, split flow shift and execution to per incoming link rather than combining them as we do in run!! Later we can optimise possibly Each PAS per bush is split in x PASs where x is the number of used in links for each bush
        Parameters:
        theMode - to use
        physicalCost - to use
        virtualCost - to use
        networkLoading - to use
        factor - to apply to flow shift
        Returns:
        true when flow is shifted, false otherwise
      • getS2SendingFlow

        public double getS2SendingFlow()
        Sending flow along PAS high cost segment
        Returns:
        high cost alternative desired flow
      • getS1SendingFlow

        public double getS1SendingFlow()
        Sending flow along PAS low cost segment
        Returns:
        low cost alternative desired flow
      • getUsedCongestedEntrySegments

        public Set<EdgeSegment> getUsedCongestedEntrySegments()
        All used entry Segments that were found to be congested and a flow shift has been applied to
        Returns:
        set of found edge segments