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 doublecomputeFreeFlowTravelTimeHour(Mode mode)Compute the free flow travel time by mode, i.e.MacroscopicLinkSegmentdeepClone()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 doublegetCapacityOrDefaultPcuH()Collect the explicitly available/set capacity in PCU/hour.default doublegetCapacityOrDefaultPcuHLane()Collect the explicitly available/set capacity in PCU/hour/lane.NodegetDownstreamVertex()Get the segment's downstream vertexMacroscopicLinkSegmentTypegetLinkSegmentType()Collect the link segment type of the link segmentdefault doublegetModelledSpeedLimitKmH(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 MacroscopicLinkgetParentLink()Return the parent link of this link segmentNodegetUpstreamVertex()Get the segment's upstream vertexdefault booleanhasLinkSegmentType()Verify if link segment type is present on the link segmentvoidsetLinkSegmentType(MacroscopicLinkSegmentType linkSegmentType)Set the link segment type this link segment adheres toMacroscopicLinkSegmentshallowClone()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:
getUpstreamVertexin interfaceEdgeSegment- Specified by:
getUpstreamVertexin interfaceLinkSegment- Returns:
- upstream vertex
-
getDownstreamVertex
Node getDownstreamVertex()
Get the segment's downstream vertex- Specified by:
getDownstreamVertexin interfaceEdgeSegment- Specified by:
getDownstreamVertexin interfaceLinkSegment- Returns:
- downstream vertex
-
getParentLink
default MacroscopicLink getParentLink()
Return the parent link of this link segment- Specified by:
getParentLinkin 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:
getCapacityOrDefaultPcuHin 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:
getCapacityOrDefaultPcuHLanein interfacePcuCapacitated- Returns:
- capacity in PCu/h
-
shallowClone
MacroscopicLinkSegment shallowClone()
Create a shallow copy of this entity- Specified by:
shallowClonein interfaceEdgeSegment- Specified by:
shallowClonein interfaceGraphEntity- Specified by:
shallowClonein interfaceIdAble- Specified by:
shallowClonein 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:
deepClonein interfaceEdgeSegment- Specified by:
deepClonein interfaceGraphEntity- Specified by:
deepClonein interfaceIdAble- Specified by:
deepClonein interfaceLinkSegment- Returns:
- deep copy of entity
-
-