Class MacroscopicLinkSegmentImpl
- java.lang.Object
-
- org.goplanit.utils.id.IdAbleImpl
-
- org.goplanit.utils.id.ExternalIdAbleImpl
-
- org.goplanit.graph.GraphEntityImpl
-
- org.goplanit.graph.directed.EdgeSegmentImpl
-
- org.goplanit.network.layer.physical.LinkSegmentImpl
-
- org.goplanit.network.layer.macroscopic.MacroscopicLinkSegmentImpl
-
- All Implemented Interfaces:
Serializable
,Cloneable
,Comparable<IdAble>
,EdgeSegment
,GraphEntity
,ExternalIdAble
,IdAble
,ManagedId
,MacroscopicLinkSegment
,LinkSegment
,PcuCapacitated
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.goplanit.network.layer.physical.LinkSegmentImpl
linkSegmentId, numberOfLanes, physicalSpeedLinkKmh
-
Fields inherited from interface org.goplanit.utils.graph.EdgeSegment
EDGE_SEGMENT_ID_CLASS
-
Fields inherited from interface org.goplanit.utils.network.layer.physical.LinkSegment
DEFAULT_MAX_SPEED, DEFAULT_NUMBER_OF_LANES, LINK_SEGMENT_ID_CLASS, MAXIMUM_DENSITY
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
MacroscopicLinkSegmentImpl(MacroscopicLinkSegmentImpl macroscopicLinkSegmentImpl)
Copy constructorprotected
MacroscopicLinkSegmentImpl(IdGroupingToken groupId, Link parentLink, boolean directionAB)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MacroscopicLinkSegmentImpl
clone()
Create a shallow copy of this entitydouble
computeFreeFlowTravelTimeHour(Mode mode)
Compute the free flow travel time by mode, i.e.Set<Mode>
getAllowedModes()
Returns the modes that are allowed on the link segmentMacroscopicLinkSegmentType
getLinkSegmentType()
Collect the link segment type of the link segmentboolean
isModeAllowed(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.goplanit.network.layer.physical.LinkSegmentImpl
generateLinkSegmentId, getDownstreamVertex, getLinkSegmentId, getNumberOfLanes, getParentEdge, getPhysicalSpeedLimitKmH, getUpstreamVertex, recreateLinkSegmentId, recreateManagedIds, setLinkSegmentId, setNumberOfLanes, setPhysicalSpeedLimitKmH
-
Methods inherited from class org.goplanit.graph.directed.EdgeSegmentImpl
isDirectionAb, remove, removeParentEdge, setDownstreamVertex, setParent, setUpstreamVertex, validate
-
Methods inherited from class org.goplanit.graph.GraphEntityImpl
generateAndSetId, generateId, toString
-
Methods inherited from class org.goplanit.utils.id.ExternalIdAbleImpl
getExternalId, getXmlId, setExternalId, setXmlId
-
Methods inherited from class org.goplanit.utils.id.IdAbleImpl
equals, generateAndSetId, getId, hashCode, setId
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.goplanit.utils.graph.EdgeSegment
getIdClass, getParentName, hasParentName, isDirectionAb, remove, removeParentEdge, replace, setDownstreamVertex, setParent, setUpstreamVertex, validate
-
Methods inherited from interface org.goplanit.utils.id.ExternalIdAble
getExternalId, getXmlId, hasExternalId, hasXmlId, setExternalId, setXmlId
-
Methods inherited from interface org.goplanit.utils.id.IdAble
compareTo, getId, idEquals, idHashCode
-
Methods inherited from interface org.goplanit.utils.network.layer.physical.LinkSegment
getDownstreamNode, getDownstreamVertex, getLinkSegmentId, getLinkSegmentIdClass, getNumberOfLanes, getParentEdge, getParentLink, getPhysicalSpeedLimitKmH, getUpstreamNode, getUpstreamVertex, setNumberOfLanes, setPhysicalSpeedLimitKmH
-
Methods inherited from interface org.goplanit.utils.network.layer.macroscopic.MacroscopicLinkSegment
getAllowedModesFrom, getCapacityOrDefaultPcuH, getCapacityOrDefaultPcuHLane, getModelledSpeedLimitKmH, hasLinkSegmentType
-
Methods inherited from interface org.goplanit.utils.id.ManagedId
recreateManagedIds, resetChildManagedIdEntities
-
-
-
-
Field Detail
-
linkSegmentType
protected MacroscopicLinkSegmentType linkSegmentType
the link type of this link containing all macroscopic features by user class
-
-
Constructor Detail
-
MacroscopicLinkSegmentImpl
protected MacroscopicLinkSegmentImpl(IdGroupingToken groupId, Link parentLink, boolean directionAB) throws PlanItException
Constructor- Parameters:
groupId
- contiguous id generation within this group for instances of this classparentLink
- the parent link of this link segmentdirectionAB
- direction of travel- Throws:
PlanItException
- thrown when error
-
MacroscopicLinkSegmentImpl
protected MacroscopicLinkSegmentImpl(MacroscopicLinkSegmentImpl macroscopicLinkSegmentImpl)
Copy constructor- Parameters:
macroscopicLinkSegmentImpl
- to copy
-
-
Method Detail
-
computeFreeFlowTravelTimeHour
public double computeFreeFlowTravelTimeHour(Mode mode)
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. In case the mode is not supported the maximum possible double value is returned as the free flow travel time- Specified by:
computeFreeFlowTravelTimeHour
in interfaceMacroscopicLinkSegment
- Parameters:
mode
- mode of travel- Returns:
- freeFlowTravelTime for this mode
-
isModeAllowed
public boolean isModeAllowed(Mode mode)
Returns whether vehicles of a specified mode are allowed through this link- Specified by:
isModeAllowed
in interfaceMacroscopicLinkSegment
- Parameters:
mode
- the specified mode- Returns:
- true if vehicles of this mode can drive along this link, false otherwise
-
getAllowedModes
public Set<Mode> getAllowedModes()
Returns the modes that are allowed on the link segment- Specified by:
getAllowedModes
in interfaceMacroscopicLinkSegment
- Returns:
- allowed modes
-
setLinkSegmentType
public void setLinkSegmentType(MacroscopicLinkSegmentType linkSegmentType)
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()
Collect the link segment type of the link segment- Specified by:
getLinkSegmentType
in interfaceMacroscopicLinkSegment
- Returns:
- the link segment
-
clone
public MacroscopicLinkSegmentImpl clone()
Create a shallow copy of this entity- Specified by:
clone
in interfaceEdgeSegment
- Specified by:
clone
in interfaceIdAble
- Overrides:
clone
in classLinkSegmentImpl
- Returns:
- shallow copy of entity
-
-