Class StaticLtmAssignmentStrategy

  • Direct Known Subclasses:
    StaticLtmBushStrategyBase, StaticLtmPathStrategy

    public abstract class StaticLtmAssignmentStrategy
    extends Object
    Base class for dealing with different assignment solution methods within sLTM. These solution methods differ regarding their approach to representing path choices, e.g. bush based, or path based.
    Author:
    markr
    • Constructor Detail

      • StaticLtmAssignmentStrategy

        public StaticLtmAssignmentStrategy​(IdGroupingToken idGroupingToken,
                                           long assignmentId,
                                           TransportModelNetwork transportModelNetwork,
                                           StaticLtmSettings settings,
                                           TrafficAssignmentComponentAccessee taComponents)
        Constructor
        Parameters:
        idGroupingToken - to use for id generation
        assignmentId - id of the parent assignment
        transportModelNetwork - the transport model network
        settings - the sLTM settings to use
        taComponents - to use
    • Method Detail

      • getTransportNetwork

        protected TransportModelNetwork getTransportNetwork()
        The transport model network used
        Returns:
        transport model network
      • getInfrastructureNetwork

        protected MacroscopicNetwork getInfrastructureNetwork()
        The physical network used
        Returns:
        the infrastructure network
      • getIdGroupingToken

        protected IdGroupingToken getIdGroupingToken()
        Token to use
        Returns:
        token
      • getAssignmentId

        protected long getAssignmentId()
        Collect parent assignment id
        Returns:
        parent assignment id
      • getLoading

        protected StaticLtmNetworkLoading getLoading()
        The network loading to apply
        Returns:
        network loading
      • getSettings

        protected StaticLtmSettings getSettings()
        The settings
        Returns:
        settings
      • getOdDemands

        protected OdDemands getOdDemands()
        Get od demands used
        Returns:
        odDemands used
      • setOdDemands

        protected void setOdDemands​(OdDemands odDemands)
        set od demand used
        Parameters:
        odDemands - to use
      • getTrafficAssignmentComponent

        protected <T> T getTrafficAssignmentComponent​(Class<T> taComponentClassKey)
        collect a component based on its class component signature key
        Type Parameters:
        T - key type of component
        Parameters:
        taComponentClassKey - class of component
        Returns:
        found component, if any
      • findCentroidVertex

        protected CentroidVertex findCentroidVertex​(OdZone zone)
        map zone to centroid vertex
        Parameters:
        zone - to map
        Returns:
        vertex found
      • verifyNetworkLoadingConvergenceProgress

        protected void verifyNetworkLoadingConvergenceProgress​(StaticLtmNetworkLoading networkLoading,
                                                               int networkLoadingIterationIndex)
        Verify convergence progress and if insufficient attempt to activate one or more extensions to overcome convergence difficulties
        Parameters:
        networkLoading - to verify progress on
        networkLoadingIterationIndex - we are at
      • executeNetworkLoading

        protected void executeNetworkLoading()
        Perform a network loading based on the current assignment state
      • createNetworkLoading

        protected abstract StaticLtmNetworkLoading createNetworkLoading()
        Factory method to create the desired network loading
        Returns:
        network loading for this solution approach
      • executeNetworkCostsUpdate

        protected void executeNetworkCostsUpdate​(Mode theMode,
                                                 boolean updateOnlyPotentiallyBlockingNodeCosts,
                                                 double[] costsToUpdate)
                                          throws PlanItException
        Perform an update of the network wide costs where a partial update is applied in case only potentially blocking nodes are updated during the loading
        Parameters:
        theMode - to perform the update for
        updateOnlyPotentiallyBlockingNodeCosts - flag indicating if only the costs of the entry link segments of potentially blocking nodes are to be updated, or all link segment costs are to be updated
        costsToUpdate - the network wide costs to update (fully or partially), this is an output
        Throws:
        PlanItException - thrown if error
      • updateTimePeriod

        public void updateTimePeriod​(TimePeriod timePeriod,
                                     Mode mode,
                                     OdDemands odDemands)
        Invoked before start of equilibrating a new time period
        Parameters:
        timePeriod - to initialise for
        mode - to initialise for
        odDemands - to use
      • hasConverged

        public boolean hasConverged​(GapFunction gapFunction,
                                    int iterationIndex)
        Verify if assignment has converged, which, means computing ths gap and determining if it has converged in this iteration in this default setup
        Parameters:
        gapFunction - to use
        iterationIndex - to use
        Returns:
        true when considered converged, false otherwise
      • createInitialSolution

        public abstract void createInitialSolution​(double[] initialLinkSegmentCosts)
        Create the initial solution to start the equilibration process with
        Parameters:
        initialLinkSegmentCosts - to use
      • performIteration

        public abstract boolean performIteration​(Mode theMode,
                                                 double[] costsToUpdate,
                                                 int iterationIndex)
        Perform a single iteration where we perform a loading and then an equilibration step resulting in updated costs
        Parameters:
        theMode - to use
        costsToUpdate - the link segment costs we are updating (possibly partially for all link segments that might have been affected by a loading
        iterationIndex - we're at
        Returns:
        true when iteration could be successfully completed, false otherwise
      • getDescription

        public abstract String getDescription()
        Description of the chosen sLTM strategy for equilibration
        Returns:
        String