Class MacroscopicLinkSegmentImpl

    • Field Detail

      • linkSegmentType

        protected MacroscopicLinkSegmentType linkSegmentType
        the link type of this link containing all macroscopic features by user class
    • Constructor Detail

      • MacroscopicLinkSegmentImpl

        public MacroscopicLinkSegmentImpl​(IdGroupingToken groupId,
                                          Link parentLink,
                                          boolean directionAB)
        Constructor
        Parameters:
        groupId - contiguous id generation within this group for instances of this class
        parentLink - the parent link of this link segment
        directionAB - direction of travel
    • Method Detail

      • computeCapacity

        public double computeCapacity()
        Return the total capacity Compute the total capacity by multiplying the capacity per lane and number of lanes
        Specified by:
        computeCapacity in interface MacroscopicLinkSegment
        Returns:
        linkSegmentCapacity in PCU
      • computeFreeFlowTravelTime

        public double computeFreeFlowTravelTime​(Mode mode)
                                         throws PlanItException
        Compute the free flow travel time by mode, i.e. when the link's maximum speed might be capped by the mode's maximum speed If the input data are invalid, this method logs the problem and returns a negative value.
        Specified by:
        computeFreeFlowTravelTime in interface MacroscopicLinkSegment
        Parameters:
        mode - mode of travel
        Returns:
        freeFlowTravelTime for this mode
        Throws:
        PlanItException - when mode is not allowed on the link
      • isModeAllowedThroughLink

        public boolean isModeAllowedThroughLink​(Mode mode)
        Returns whether vehicles of a specified mode are allowed through this link
        Specified by:
        isModeAllowedThroughLink in interface LinkSegment
        Parameters:
        mode - the specified mode
        Returns:
        true if vehicles of this mode can drive along this link, false otherwise