Interface MacroscopicLinkSegment
-
- All Superinterfaces:
Comparable<IdAble>
,EdgeSegment
,ExternalIdAble
,GraphEntity
,IdAble
,LinkSegment
,ManagedId
,PcuCapacitated
,Serializable
- All Known Implementing Classes:
MacroscopicLinkSegmentImpl
public interface MacroscopicLinkSegment extends LinkSegment, PcuCapacitated
Macroscopic traffic modeling oriented link segment.- Author:
- markr
-
-
Field Summary
-
Fields inherited from interface org.goplanit.utils.graph.directed.EdgeSegment
EDGE_SEGMENT_ID_CLASS, getDownstreamVertex, getUpstreamVertex
-
Fields inherited from interface org.goplanit.utils.network.layer.physical.LinkSegment
DEFAULT_MAX_SPEED, DEFAULT_NUMBER_OF_LANES, LINK_SEGMENT_ID_CLASS, MAXIMUM_DENSITY
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description double
computeFreeFlowTravelTimeHour(Mode mode)
Compute the free flow travel time by mode, i.e.MacroscopicLinkSegment
deepClone()
An id entity should always support a deep copy, i.e., all "owned" members will be deep copied when a clone of this instance is created via this call.default double
getCapacityOrDefaultPcuH()
Collect the explicitly available/set capacity in PCU/hour.default double
getCapacityOrDefaultPcuHLane()
Collect the explicitly available/set capacity in PCU/hour/lane.Node
getDownstreamVertex()
Get the segment's downstream vertexMacroscopicLinkSegmentType
getLinkSegmentType()
Collect the link segment type of the link segmentdefault double
getModelledSpeedLimitKmH(Mode mode)
Collect the maximum speed limit for the mode by taking the minimum of: (i) physical speed limit, (ii) mode's maximum speed limit, (iii) link segment type's mode specific speed limit.default MacroscopicLink
getParentLink()
Return the parent link of this link segmentNode
getUpstreamVertex()
Get the segment's upstream vertexdefault boolean
hasLinkSegmentType()
Verify if link segment type is present on the link segmentvoid
setLinkSegmentType(MacroscopicLinkSegmentType linkSegmentType)
Set the link segment type this link segment adheres toMacroscopicLinkSegment
shallowClone()
Create a shallow copy of this entity-
Methods inherited from interface org.goplanit.utils.graph.directed.EdgeSegment
getIdClass, getLengthKm, getOppositeDirectionSegment, getParentName, hasGeometry, hasParent, hasParentName, isAdjacent, isDirectionAb, isParentGeometryInSegmentDirection, removeParentEdge, setParent, validate
-
Methods inherited from interface org.goplanit.utils.id.ExternalIdAble
appendExternalId, appendExternalId, getExternalId, getIdsAsString, getSplitExternalId, getSplitExternalId, getXmlId, hasExternalId, hasXmlId, setExternalId, setXmlId, 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
generateLinkSegmentId, getAllowedModes, getAllowedModesFrom, getDownstreamNode, getLinkSegmentId, getLinkSegmentIdClass, getNumberOfLanes, getParent, getPhysicalSpeedLimitKmH, getUpstreamNode, hasNode, isDownstreamNode, isModeAllowed, isUpstreamNode, setNumberOfLanes, setPhysicalSpeedLimitKmH
-
Methods inherited from interface org.goplanit.utils.id.ManagedId
recreateManagedIds, resetChildManagedIdEntities
-
-
-
-
Method Detail
-
computeFreeFlowTravelTimeHour
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- Parameters:
mode
- mode of travel- Returns:
- freeFlowTravelTime for this mode
-
getModelledSpeedLimitKmH
default double getModelledSpeedLimitKmH(Mode mode)
Collect the maximum speed limit for the mode by taking the minimum of: (i) physical speed limit, (ii) mode's maximum speed limit, (iii) link segment type's mode specific speed limit. It is possible the link segment type's mode specific speed limit exceeds the physical speed limit. This can happen when the user has assigned a type to the link that is less restrictive than the physical speed limit sign indicates It is also possible the link segment type's mode specific speed limit is more restrictive than the physical speed limit. For example when trucks are on a motorway and they have a designated lower speed limit. It is also possible the mode's global speed limit is more restrictive than the physical speed limit. For example when trucks are on a motorway and the physical speed limit exceeds the mode specific one Hence, it is important to always use this speed limit value when collecting speed limits, rather than collecting the physical, mode specific, or link type/mode specific speed limits- Parameters:
mode
- to collect modelled maximum speed for- Returns:
- modelled speed limit, when mode is not allowed on link, 0 is returned
-
setLinkSegmentType
void setLinkSegmentType(MacroscopicLinkSegmentType linkSegmentType)
Set the link segment type this link segment adheres to- Parameters:
linkSegmentType
- the link segment type
-
getLinkSegmentType
MacroscopicLinkSegmentType getLinkSegmentType()
Collect the link segment type of the link segment- Returns:
- the link segment
-
hasLinkSegmentType
default boolean hasLinkSegmentType()
Verify if link segment type is present on the link segment- Returns:
- true if present, false otherwise
-
getUpstreamVertex
Node getUpstreamVertex()
Get the segment's upstream vertex- Specified by:
getUpstreamVertex
in interfaceEdgeSegment
- Specified by:
getUpstreamVertex
in interfaceLinkSegment
- Returns:
- upstream vertex
-
getDownstreamVertex
Node getDownstreamVertex()
Get the segment's downstream vertex- Specified by:
getDownstreamVertex
in interfaceEdgeSegment
- Specified by:
getDownstreamVertex
in interfaceLinkSegment
- Returns:
- downstream vertex
-
getParentLink
default MacroscopicLink 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
-
getCapacityOrDefaultPcuH
default double getCapacityOrDefaultPcuH()
Collect the explicitly available/set capacity in PCU/hour. In case no explicit capacity is provided a default is to be returned- Specified by:
getCapacityOrDefaultPcuH
in interfacePcuCapacitated
- Returns:
- capacity in PCu/h
-
getCapacityOrDefaultPcuHLane
default double getCapacityOrDefaultPcuHLane()
Collect the explicitly available/set capacity in PCU/hour/lane. In case no explicit capacity is provided a default is to be returned- Specified by:
getCapacityOrDefaultPcuHLane
in interfacePcuCapacitated
- Returns:
- capacity in PCu/h
-
shallowClone
MacroscopicLinkSegment shallowClone()
Create a shallow copy of this entity- Specified by:
shallowClone
in interfaceEdgeSegment
- Specified by:
shallowClone
in interfaceGraphEntity
- Specified by:
shallowClone
in interfaceIdAble
- Specified by:
shallowClone
in interfaceLinkSegment
- Returns:
- shallow copy of entity
-
deepClone
MacroscopicLinkSegment deepClone()
An id entity should always support a deep copy, i.e., all "owned" members will be deep copied when a clone of this instance is created via this call. To be used with caution if not called by managed id container related code- Specified by:
deepClone
in interfaceEdgeSegment
- Specified by:
deepClone
in interfaceGraphEntity
- Specified by:
deepClone
in interfaceIdAble
- Specified by:
deepClone
in interfaceLinkSegment
- Returns:
- deep copy of entity
-
-