Package org.planit.network.physical
Class LinkSegmentImpl
- java.lang.Object
-
- org.planit.graph.EdgeSegmentImpl
-
- org.planit.network.physical.LinkSegmentImpl
-
- All Implemented Interfaces:
Serializable,Comparable<EdgeSegment>,EdgeSegment,LinkSegment
- Direct Known Subclasses:
MacroscopicLinkSegmentImpl
public abstract class LinkSegmentImpl extends EdgeSegmentImpl implements LinkSegment
Link segment object representing physical links in the network and storing their properties- Author:
- gman6028, markr
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected longlinkSegmentIdunique internal identifierprotected Map<Mode,Double>maximumSpeedMapMap of maximum speeds along this link for each modeprotected intnumberOfLanessegment's number of lanes-
Fields inherited from class org.planit.graph.EdgeSegmentImpl
downstreamVertex, externalId, id, parentEdge, upstreamVertex
-
Fields inherited from interface org.planit.utils.network.physical.LinkSegment
DEFAULT_MAX_SPEED, DEFAULT_NUMBER_OF_LANES, MAXIMUM_DENSITY
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedLinkSegmentImpl(IdGroupingToken groupId, Link parentLink, boolean directionAB)Constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected static intgenerateLinkSegmentId(IdGroupingToken groupId)Generate unique link segment idlonggetLinkSegmentId()Return id of this instance.doublegetMaximumSpeed(Mode mode)Return the maximum speed along this link for a specified modeintgetNumberOfLanes()Collect the number of lanes of this segmentLinkgetParentLink()Return the parent link of this link segmentvoidsetMaximumSpeed(Mode mode, double maximumSpeed)Set the maximum speed along this link for a specified modevoidsetNumberOfLanes(int numberOfLanes)Set the number of lanes-
Methods inherited from class org.planit.graph.EdgeSegmentImpl
compareTo, generateEdgeSegmentId, getDownstreamVertex, getExternalId, getId, getParentEdge, getUpstreamVertex, hasExternalId, setExternalId
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.lang.Comparable
compareTo
-
Methods inherited from interface org.planit.utils.graph.EdgeSegment
getDownstreamVertex, getExternalId, getId, getParentEdge, getUpstreamVertex, hasExternalId, setExternalId
-
Methods inherited from interface org.planit.utils.network.physical.LinkSegment
isModeAllowedThroughLink
-
-
-
-
Constructor Detail
-
LinkSegmentImpl
protected LinkSegmentImpl(IdGroupingToken groupId, Link parentLink, boolean directionAB)
Constructor- Parameters:
groupId- , contiguous id generation within this group for instances of this classparentLink- parent link of segmentdirectionAB- 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:LinkSegmentReturn id of this instance. This id is expected to be generated using the org.planit.utils.misc.IdGenerator- Specified by:
getLinkSegmentIdin interfaceLinkSegment- Returns:
- link segment id
-
getNumberOfLanes
public int getNumberOfLanes()
Description copied from interface:LinkSegmentCollect the number of lanes of this segment- Specified by:
getNumberOfLanesin interfaceLinkSegment- Returns:
- number of lanes
-
setNumberOfLanes
public void setNumberOfLanes(int numberOfLanes)
Description copied from interface:LinkSegmentSet the number of lanes- Specified by:
setNumberOfLanesin interfaceLinkSegment- Parameters:
numberOfLanes- to set
-
getMaximumSpeed
public double getMaximumSpeed(Mode mode)
Return the maximum speed along this link for a specified mode- Specified by:
getMaximumSpeedin interfaceLinkSegment- 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:
setMaximumSpeedin interfaceLinkSegment- Parameters:
mode- the specified modemaximumSpeed- maximum speed along this link for the specified mode
-
getParentLink
public Link getParentLink()
Return the parent link of this link segment- Specified by:
getParentLinkin interfaceLinkSegment- Returns:
- Link object which is the parent of this link segment
-
-