Interface MacroscopicLinkSegment
-
- All Superinterfaces:
Comparable<Idable>
,EdgeSegment
,ExternalIdable
,Idable
,LinkSegment
,Serializable
- All Known Implementing Classes:
MacroscopicLinkSegmentImpl
public interface MacroscopicLinkSegment extends LinkSegment
Macroscopic traffic modeling oriented link segment- Author:
- markr
-
-
Field Summary
-
Fields inherited from interface org.planit.utils.network.physical.LinkSegment
DEFAULT_MAX_SPEED, DEFAULT_NUMBER_OF_LANES, MAXIMUM_DENSITY
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description double
computeCapacityPcuH()
Return the total link segment capacity in pcu/hdouble
computeFreeFlowTravelTime(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 segmentdouble
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 boolean
hasLinkSegmentType()
Verify if link segment type is present on 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 interface org.planit.utils.graph.EdgeSegment
clone, 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
-
Methods inherited from interface org.planit.utils.network.physical.LinkSegment
getLinkSegmentId, getNumberOfLanes, getParentLink, getPhysicalSpeedLimitKmH, setNumberOfLanes, setPhysicalSpeedLimitKmH
-
-
-
-
Method Detail
-
isModeAllowed
boolean isModeAllowed(Mode mode)
Returns whether vehicles of a specified mode are allowed through this link- Parameters:
mode
- the specified mode- Returns:
- true if vehicles of this mode can drive along this link, false otherwise
-
getAllowedModes
Set<Mode> getAllowedModes()
Returns the modes that are allowed on the link segment- Returns:
- allowed modes
-
computeCapacityPcuH
double computeCapacityPcuH()
Return the total link segment capacity in pcu/h- Returns:
- linkSegmentCapacity in PCU/h
-
computeFreeFlowTravelTime
double computeFreeFlowTravelTime(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.- Parameters:
mode
- mode of travel- Returns:
- freeFlowTravelTime for this mode
-
getModelledSpeedLimitKmH
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
-
-