Class TrafficAssignment

    • Field Detail

      • transportNetwork

        protected TransportNetwork transportNetwork
        The transport network to use which is an adaptor around the physical network and the zoning
      • numberOfNetworkSegments

        protected int numberOfNetworkSegments
        holds the count of all link segments in the transport network
      • numberOfNetworkVertices

        protected int numberOfNetworkVertices
        holds the count of all vertices in the transport network
      • smoothing

        protected Smoothing smoothing
        the smoothing to use
      • demands

        protected Demands demands
        The demand to use
      • initialLinkSegmentCost

        protected InitialLinkSegmentCost initialLinkSegmentCost
        The initial link segment cost
      • initialLinkSegmentCostByTimePeriod

        protected Map<TimePeriod,​InitialLinkSegmentCost> initialLinkSegmentCostByTimePeriod
        Map storing InitialLinkSegmentCost objects for each time period
      • TRADITIONAL_STATIC_ASSIGNMENT

        public static String TRADITIONAL_STATIC_ASSIGNMENT
        short hand to choose traditional static assignment as assignment type
      • ALGORITHM_B

        public static String ALGORITHM_B
        short hand to choose algorithmB as assignment type
      • ELTM

        public static String ELTM
        short hand to choose eLTM as assignment type
    • Constructor Detail

      • TrafficAssignment

        public TrafficAssignment​(IdGroupingToken groupId)
        Constructor. Note that defaults that partly depend on derived classes are assumed to be invoked by the calling method via this.initialiseDefaults()
        Parameters:
        groupId - contiguous id generation within this group for instances of this class
    • Method Detail

      • createLoggingPrefix

        protected String createLoggingPrefix​(int iterationIndex)
        create the logging prefix for logging statements during equilibration
        Parameters:
        iterationIndex - the iteration
        Returns:
        prefix for logging of traffic assignment messages
      • checkForEmptyComponents

        protected void checkForEmptyComponents()
                                        throws PlanItException
        Check if any components are undefined, if so throw exception
        Throws:
        PlanItException - thrown if any components are undefined
      • verifyComponentCompatibility

        protected void verifyComponentCompatibility()
                                             throws PlanItException
        Verify if the traffic assignment components are compatible and nonnull
        Throws:
        PlanItException - thrown if the components are not compatible
      • createTransportNetwork

        protected void createTransportNetwork()
                                       throws PlanItException
        Initialize the transport network by combining the physical and virtual components
        Throws:
        PlanItException - thrown if there is an error
      • disbandTransportNetwork

        protected void disbandTransportNetwork()
                                        throws PlanItException
        detach the virtual and physical transport network again
        Throws:
        PlanItException - thrown if there is an error
      • initialiseBeforeExecution

        protected void initialiseBeforeExecution()
                                          throws PlanItException
        Initialize all relevant traffic assignment components before execution of the assignment commences
        Throws:
        PlanItException - thrown if there is an error
      • finalizeAfterExecution

        protected void finalizeAfterExecution()
                                       throws PlanItException
        Finalize all relevant traffic assignment components after execution of the assignment has ended
        Throws:
        PlanItException - thrown if there is an error
      • getOutputManager

        protected OutputManager getOutputManager()
        Collect the output manager
        Returns:
        output manager for this assignment
      • createOutputTypeAdapter

        public abstract OutputTypeAdapter createOutputTypeAdapter​(OutputType outputType)
        Create the output type adapter for the current output type, specifically tailored towards the assignment type that we are builing
        Parameters:
        outputType - the current output type
        Returns:
        the output type adapter corresponding to the current traffic assignment and output type
      • executeEquilibration

        public abstract void executeEquilibration()
                                           throws PlanItException
        Run equilibration after resources initialized, including saving results
        Throws:
        PlanItException - thrown if there is an error
      • getIterationIndex

        public abstract int getIterationIndex()
        Collect the current iteration index of the simulation
        Returns:
        current iteration index
      • execute

        public void execute()
                     throws PlanItException
        Execute assignment, including initializing resources, running equilibration and then closing resources
        Throws:
        PlanItException - thrown if there is an error
      • getTransportNetwork

        public TransportNetwork getTransportNetwork()
        Get the TransportNetwork used in the current assignment
        Returns:
        TransportNetwork used in current assignment
      • setSmoothing

        public void setSmoothing​(Smoothing smoothing)
        Set the Smoothing object for the current assignment
        Parameters:
        smoothing - Smoothing object for the current assignment
      • getSmoothing

        public Smoothing getSmoothing()
        Collect the smoothing object for the current traffic assignment
        Returns:
        smoothing
      • setGapFunction

        public void setGapFunction​(GapFunction gapfunction)
        Collect the gap function which is to be set by a derived class of TrafficAssignment via the initialiseDefaults() right after construction
        Parameters:
        gapfunction - the gap function to set
      • getGapFunction

        public GapFunction getGapFunction()
        Collect the gap function which is to be set by a derived class of TrafficAssignment via the initialiseDefaults() right after construction
        Returns:
        gapFunction
      • setInfrastructureNetwork

        public void setInfrastructureNetwork​(InfrastructureNetwork network)
        Set the network for the current assignment
        Parameters:
        network - the network object for the current assignment
      • setDemands

        public void setDemands​(Demands demands)
        Set the Demands object for the current assignment
        Parameters:
        demands - the Demands object for the current assignment
      • setZoning

        public void setZoning​(Zoning zoning)
        Set the zoning object for the current assignment
        Parameters:
        zoning - the Zoning object for the current assignment
      • setInitialLinkSegmentCost

        public void setInitialLinkSegmentCost​(InitialLinkSegmentCost initialLinkSegmentCost)
        Set the initial link segment cost unrelated to any particular time period, i.e., used for all time periods that do not have designated initial costs specified for them
        Parameters:
        initialLinkSegmentCost - the initial link segment cost
      • setInitialLinkSegmentCost

        public void setInitialLinkSegmentCost​(TimePeriod timePeriod,
                                              InitialLinkSegmentCost initialLinkSegmentCost)
        Set the initial link segment cost for a specified time period, otherwise revert to the general initial link segment cost (if any)
        Parameters:
        timePeriod - the specified time period
        initialLinkSegmentCost - the initial link segment cost
      • setPhysicalCost

        public void setPhysicalCost​(AbstractPhysicalCost physicalCost)
                             throws PlanItException
        Set the physical cost where in case the cost is an InteractorAccessor will trigger an event to get access to the required data via requesting an InteractorAccessee
        Parameters:
        physicalCost - the physical cost object for the current assignment
        Throws:
        PlanItException - thrown if there is an error
      • getPhysicalCost

        public AbstractPhysicalCost getPhysicalCost()
        Get the dynamic physical cost object for the current assignment
        Returns:
        the physical cost object for the current assignment
      • getVirtualCost

        public AbstractVirtualCost getVirtualCost()
        Returns the virtual cost object for the current assignment
        Returns:
        the virtual cost object for the current assignments
      • setVirtualCost

        public void setVirtualCost​(AbstractVirtualCost virtualCost)
                            throws PlanItException
        Set the virtual cost where in case the cost is an InteractorAccessor will trigger an event to get access to the required data via requesting an InteractorAccessee
        Parameters:
        virtualCost - the virtual cost object to be assigned
        Throws:
        PlanItException - thrown if there is an error
      • setOutputManager

        public void setOutputManager​(OutputManager outputManager)
        Set the output manager which holds all the configuration options regarding this assignment
        Parameters:
        outputManager - to set