Class LinkSegmentImpl

    • Field Detail

      • linkSegmentId

        protected final long linkSegmentId
        unique internal identifier
      • numberOfLanes

        protected int numberOfLanes
        segment's number of lanes
      • maximumSpeedMap

        protected Map<Mode,​Double> maximumSpeedMap
        Map of maximum speeds along this link for each mode
    • Constructor Detail

      • LinkSegmentImpl

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

      • generateLinkSegmentId

        protected static int generateLinkSegmentId​(IdGroupingToken groupId)
        Generate unique link segment id
        Parameters:
        groupId - , contiguous id generation within this group for instances of this class
        Returns:
        id of this link segment
      • getLinkSegmentId

        public long getLinkSegmentId()
        Description copied from interface: LinkSegment
        Return id of this instance. This id is expected to be generated using the org.planit.utils.misc.IdGenerator
        Specified by:
        getLinkSegmentId in interface LinkSegment
        Returns:
        link segment id
      • getNumberOfLanes

        public int getNumberOfLanes()
        Description copied from interface: LinkSegment
        Collect the number of lanes of this segment
        Specified by:
        getNumberOfLanes in interface LinkSegment
        Returns:
        number of lanes
      • setNumberOfLanes

        public void setNumberOfLanes​(int numberOfLanes)
        Description copied from interface: LinkSegment
        Set the number of lanes
        Specified by:
        setNumberOfLanes in interface LinkSegment
        Parameters:
        numberOfLanes - to set
      • getMaximumSpeed

        public double getMaximumSpeed​(Mode mode)
        Return the maximum speed along this link for a specified mode
        Specified by:
        getMaximumSpeed in interface LinkSegment
        Parameters:
        mode - the specified mode
        Returns:
        maximum speed along this link for the specified mode
      • setMaximumSpeed

        public void setMaximumSpeed​(Mode mode,
                                    double maximumSpeed)
        Set the maximum speed along this link for a specified mode
        Specified by:
        setMaximumSpeed in interface LinkSegment
        Parameters:
        mode - the specified mode
        maximumSpeed - maximum speed along this link for the specified mode
      • getParentLink

        public Link getParentLink()
        Return the parent link of this link segment
        Specified by:
        getParentLink in interface LinkSegment
        Returns:
        Link object which is the parent of this link segment