Class LinkSegmentBase<L extends Link>

    • 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

      • LinkSegmentBase

        protected LinkSegmentBase​(IdGroupingToken groupId,
                                  boolean directionAB)
        Constructor
        Parameters:
        groupId - , contiguous id generation within this group for instances of this class
        directionAB - direction of travel
      • LinkSegmentBase

        protected LinkSegmentBase​(IdGroupingToken groupId,
                                  L 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
      • LinkSegmentBase

        protected LinkSegmentBase​(LinkSegmentBase<L> other,
                                  boolean deepCopy)
        Copy constructor
        Parameters:
        other - to copy
        deepCopy - when true, create a deep copy, shallow copy otherwise
    • Method Detail

      • setLinkSegmentId

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

        protected long recreateLinkSegmentId​(IdGroupingToken tokenId)
        recreate the internal link segment id and set it
        Parameters:
        tokenId - to use
        Returns:
        updated id
      • recreateManagedIds

        public long recreateManagedIds​(IdGroupingToken tokenId)
        Recreate internal ids: id and link segment id
        Specified by:
        recreateManagedIds in interface ManagedId
        Overrides:
        recreateManagedIds in class GraphEntityImpl
        Parameters:
        tokenId - to use (may be null in case managed id entity does not rely on token to recreate its managed id(s))
        Returns:
        recreated id
      • 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 LinkSegment setNumberOfLanes​(int numberOfLanes)
        Set the number of lanes
        Specified by:
        setNumberOfLanes in interface LinkSegment
        Parameters:
        numberOfLanes - to set
        Returns:
        this link segment
      • setPhysicalSpeedLimitKmH

        public LinkSegment setPhysicalSpeedLimitKmH​(double maximumSpeed)
        This is the maximum speed that is physically present and a driver can observe from the signs on the road (km/h)
        Specified by:
        setPhysicalSpeedLimitKmH in interface LinkSegment
        Parameters:
        maximumSpeed - to set
        Returns:
        this linkSegment
      • 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