Class LinkSegmentImpl

    • Field Detail

      • linkSegmentId

        protected long linkSegmentId
        unique internal identifier
      • numberOfLanes

        protected int numberOfLanes
        segment's number of lanes
      • physicalSpeedLinkKmh

        protected double physicalSpeedLinkKmh
        physical maximum speed on the link segment in km/h
    • Constructor Detail

      • LinkSegmentImpl

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

        protected LinkSegmentImpl​(LinkSegmentImpl linkSegmentImpl)
        Copy constructor
        Parameters:
        linkSegmentImpl - to copy
    • Method Detail

      • generateLinkSegmentId

        protected static long 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
      • setLinkSegmentId

        protected void setLinkSegmentId​(long linkSegmentId)
        Set the link segment id
        Parameters:
        linkSegmentId - to use
      • getLinkSegmentId

        public long getLinkSegmentId()
        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()
        Collect the number of lanes of this segment
        Specified by:
        getNumberOfLanes in interface LinkSegment
        Returns:
        number of lanes
      • setNumberOfLanes

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

        public void setPhysicalSpeedLimitKmH​(double maximumSpeed)
        This is the maximum speed that is physically present and a driver can observe from the signs on the road
        Specified by:
        setPhysicalSpeedLimitKmH in interface LinkSegment
        Parameters:
        maximumSpeed - physical speed limit
      • getPhysicalSpeedLimitKmH

        public double getPhysicalSpeedLimitKmH()
        This is the maximum speed that is physically present and a driver can observe from the signs on the road
        Specified by:
        getPhysicalSpeedLimitKmH in interface LinkSegment
        Returns:
        maximumSpeed
      • 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