Package org.planit.network.physical
Class LinkSegmentImpl
- java.lang.Object
-
- org.planit.graph.EdgeSegmentImpl
-
- org.planit.network.physical.LinkSegmentImpl
-
- All Implemented Interfaces:
Serializable,Comparable<Idable>,EdgeSegment,ExternalIdable,Idable,LinkSegment
- Direct Known Subclasses:
MacroscopicLinkSegmentImpl
public 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 intnumberOfLanessegment's number of lanesprotected doublephysicalSpeedLinkKmhphysical maximum speed on the link segment in km/h-
Fields inherited from class org.planit.graph.EdgeSegmentImpl
xmlId
-
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(LinkSegmentImpl linkSegmentImpl)Copy constructorprotectedLinkSegmentImpl(IdGroupingToken groupId, Link parentLink, boolean directionAB)Constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description LinkSegmentImplclone()Clone the edge segmentprotected static longgenerateLinkSegmentId(IdGroupingToken groupId)Generate unique link segment idlonggetLinkSegmentId()Return id of this instance.intgetNumberOfLanes()Collect the number of lanes of this segmentLinkgetParentLink()Return the parent link of this link segmentdoublegetPhysicalSpeedLimitKmH()This is the maximum speed that is physically present and a driver can observe from the signs on the roadprotected voidsetLinkSegmentId(long linkSegmentId)Set the link segment idvoidsetNumberOfLanes(int numberOfLanes)Set the number of lanesvoidsetPhysicalSpeedLimitKmH(double maximumSpeed)This is the maximum speed that is physically present and a driver can observe from the signs on the road-
Methods inherited from class org.planit.graph.EdgeSegmentImpl
equals, generateEdgeSegmentId, getDownstreamVertex, getExternalId, getId, getParentEdge, getUpstreamVertex, getXmlId, hashCode, isDirectionAb, remove, removeParentEdge, setDownstreamVertex, setExternalId, setId, setParentEdge, setUpstreamVertex, setXmlId, validate
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.planit.utils.graph.EdgeSegment
getDownstreamVertex, getParentEdge, getUpstreamVertex, isDirectionAb, remove, removeParentEdge, replace, setDownstreamVertex, setParentEdge, setUpstreamVertex, validate
-
Methods inherited from interface org.planit.utils.id.ExternalIdable
getExternalId, getXmlId, hasExternalId, hasXmlId, setExternalId, setXmlId
-
Methods inherited from interface org.planit.utils.id.Idable
compareTo, getId, idEquals, idHashCode
-
-
-
-
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 classparentLink- parent link of segmentdirectionAB- 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:
getLinkSegmentIdin interfaceLinkSegment- Returns:
- link segment id
-
getNumberOfLanes
public int getNumberOfLanes()
Collect the number of lanes of this segment- Specified by:
getNumberOfLanesin interfaceLinkSegment- Returns:
- number of lanes
-
setNumberOfLanes
public void setNumberOfLanes(int numberOfLanes)
Set the number of lanes- Specified by:
setNumberOfLanesin interfaceLinkSegment- 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:
setPhysicalSpeedLimitKmHin interfaceLinkSegment- 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:
getPhysicalSpeedLimitKmHin interfaceLinkSegment- Returns:
- maximumSpeed
-
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
-
clone
public LinkSegmentImpl clone()
Clone the edge segment- Specified by:
clonein interfaceEdgeSegment- Overrides:
clonein classEdgeSegmentImpl- Returns:
- copy of this instance
-
-