Class InitialLinkSegmentCost

    • Field Detail

      • costPerModeAndLinkSegment

        protected Map<Long,​Map<Long,​Double>> costPerModeAndLinkSegment
        Map to store initial cost for each mode and link segment
    • Constructor Detail

      • InitialLinkSegmentCost

        public InitialLinkSegmentCost​(IdGroupingToken groupId)
        Constructor
        Parameters:
        groupId - , contiguous id generation within this group for instances of this class
    • Method Detail

      • isSegmentCostsSetForMode

        public boolean isSegmentCostsSetForMode​(Mode mode)
        Are link segment costs available for the given mode
        Parameters:
        mode - the mode
        Returns:
        true when available, false otherwise
      • getSegmentCost

        public double getSegmentCost​(Mode mode,
                                     MacroscopicLinkSegment linkSegment)
        Returns the initial cost for each link segment and mode. When absent but mode is not allowed, positive infinity is used, otherwise we revert to free flow travel time and a warning is logged.
        Parameters:
        mode - the current mode
        linkSegment - the current link segment
        Returns:
        the cost for this link segment and mode
      • setSegmentCost

        public void setSegmentCost​(Mode mode,
                                   MacroscopicLinkSegment linkSegment,
                                   double cost)
        Sets the initial cost for each link segment and mode
        Specified by:
        setSegmentCost in class InitialPhysicalCost
        Parameters:
        mode - the current mode
        linkSegment - the current link segment
        cost - the initial cost for this link segment and mode
      • setSegmentCost

        public void setSegmentCost​(Mode mode,
                                   long linkSegmentId,
                                   double cost)
        Sets the initial cost for each link segment and mode
        Parameters:
        mode - the current mode
        linkSegmentId - the id of the current link segment
        cost - the initial cost for this link segment and mode At present this method is only used in unit tests.