Class MacroscopicLinkSegmentImpl
- java.lang.Object
-
- org.planit.graph.EdgeSegmentImpl
-
- org.planit.network.physical.LinkSegmentImpl
-
- org.planit.network.physical.macroscopic.MacroscopicLinkSegmentImpl
-
- All Implemented Interfaces:
Serializable
,Comparable<EdgeSegment>
,EdgeSegment
,LinkSegment
,MacroscopicLinkSegment
public class MacroscopicLinkSegmentImpl extends LinkSegmentImpl implements MacroscopicLinkSegment
Link segment for macroscopic transport networks.- Author:
- markr
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected MacroscopicLinkSegmentType
linkSegmentType
the link type of this link containing all macroscopic features by user class-
Fields inherited from class org.planit.network.physical.LinkSegmentImpl
linkSegmentId, maximumSpeedMap, numberOfLanes
-
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 Constructor Description MacroscopicLinkSegmentImpl(IdGroupingToken groupId, Link parentLink, boolean directionAB)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
computeCapacity()
Return the total capacity Compute the total capacity by multiplying the capacity per lane and number of lanesdouble
computeFreeFlowTravelTime(Mode mode)
Compute the free flow travel time by mode, i.e.MacroscopicLinkSegmentType
getLinkSegmentType()
Collect the link segment type of the link segmentboolean
isModeAllowedThroughLink(Mode mode)
Returns whether vehicles of a specified mode are allowed through this linkvoid
setLinkSegmentType(MacroscopicLinkSegmentType linkSegmentType)
Set the link segment type this link segment adheres to-
Methods inherited from class org.planit.network.physical.LinkSegmentImpl
generateLinkSegmentId, getLinkSegmentId, getMaximumSpeed, getNumberOfLanes, getParentLink, setMaximumSpeed, setNumberOfLanes
-
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
getLinkSegmentId, getMaximumSpeed, getNumberOfLanes, getParentLink, setMaximumSpeed, setNumberOfLanes
-
-
-
-
Field Detail
-
linkSegmentType
protected MacroscopicLinkSegmentType linkSegmentType
the link type of this link containing all macroscopic features by user class
-
-
Constructor Detail
-
MacroscopicLinkSegmentImpl
public MacroscopicLinkSegmentImpl(IdGroupingToken groupId, Link parentLink, boolean directionAB)
Constructor- Parameters:
groupId
- contiguous id generation within this group for instances of this classparentLink
- the parent link of this link segmentdirectionAB
- direction of travel
-
-
Method Detail
-
computeCapacity
public double computeCapacity()
Return the total capacity Compute the total capacity by multiplying the capacity per lane and number of lanes- Specified by:
computeCapacity
in interfaceMacroscopicLinkSegment
- Returns:
- linkSegmentCapacity in PCU
-
computeFreeFlowTravelTime
public double computeFreeFlowTravelTime(Mode mode) throws PlanItException
Compute the free flow travel time by mode, i.e. when the link's maximum speed might be capped by the mode's maximum speed If the input data are invalid, this method logs the problem and returns a negative value.- Specified by:
computeFreeFlowTravelTime
in interfaceMacroscopicLinkSegment
- Parameters:
mode
- mode of travel- Returns:
- freeFlowTravelTime for this mode
- Throws:
PlanItException
- when mode is not allowed on the link
-
isModeAllowedThroughLink
public boolean isModeAllowedThroughLink(Mode mode)
Returns whether vehicles of a specified mode are allowed through this link- Specified by:
isModeAllowedThroughLink
in interfaceLinkSegment
- Parameters:
mode
- the specified mode- Returns:
- true if vehicles of this mode can drive along this link, false otherwise
-
setLinkSegmentType
public void setLinkSegmentType(MacroscopicLinkSegmentType linkSegmentType)
Description copied from interface:MacroscopicLinkSegment
Set the link segment type this link segment adheres to- Specified by:
setLinkSegmentType
in interfaceMacroscopicLinkSegment
- Parameters:
linkSegmentType
- the link segment type
-
getLinkSegmentType
public MacroscopicLinkSegmentType getLinkSegmentType()
Description copied from interface:MacroscopicLinkSegment
Collect the link segment type of the link segment- Specified by:
getLinkSegmentType
in interfaceMacroscopicLinkSegment
- Returns:
- the link segment
-
-