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 long
linkSegmentId
unique internal identifierprotected int
numberOfLanes
segment's number of lanesprotected double
physicalSpeedLinkKmh
physical 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 protected
LinkSegmentImpl(LinkSegmentImpl linkSegmentImpl)
Copy constructorprotected
LinkSegmentImpl(IdGroupingToken groupId, Link parentLink, boolean directionAB)
Constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description LinkSegmentImpl
clone()
Clone the edge segmentprotected static long
generateLinkSegmentId(IdGroupingToken groupId)
Generate unique link segment idlong
getLinkSegmentId()
Return id of this instance.int
getNumberOfLanes()
Collect the number of lanes of this segmentLink
getParentLink()
Return the parent link of this link segmentdouble
getPhysicalSpeedLimitKmH()
This is the maximum speed that is physically present and a driver can observe from the signs on the roadprotected void
setLinkSegmentId(long linkSegmentId)
Set the link segment idvoid
setNumberOfLanes(int numberOfLanes)
Set the number of lanesvoid
setPhysicalSpeedLimitKmH(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:
getLinkSegmentId
in interfaceLinkSegment
- Returns:
- link segment id
-
getNumberOfLanes
public int getNumberOfLanes()
Collect the number of lanes of this segment- Specified by:
getNumberOfLanes
in interfaceLinkSegment
- Returns:
- number of lanes
-
setNumberOfLanes
public void setNumberOfLanes(int numberOfLanes)
Set the number of lanes- Specified by:
setNumberOfLanes
in 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:
setPhysicalSpeedLimitKmH
in 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:
getPhysicalSpeedLimitKmH
in interfaceLinkSegment
- Returns:
- maximumSpeed
-
getParentLink
public Link getParentLink()
Return the parent link of this link segment- Specified by:
getParentLink
in interfaceLinkSegment
- Returns:
- Link object which is the parent of this link segment
-
clone
public LinkSegmentImpl clone()
Clone the edge segment- Specified by:
clone
in interfaceEdgeSegment
- Overrides:
clone
in classEdgeSegmentImpl
- Returns:
- copy of this instance
-
-