Interface LinkSegment
-
- All Superinterfaces:
Comparable<EdgeSegment>,EdgeSegment,Serializable
- All Known Subinterfaces:
MacroscopicLinkSegment
- All Known Implementing Classes:
LinkSegmentImpl,MacroscopicLinkSegmentImpl
public interface LinkSegment extends EdgeSegment
-
-
Field Summary
Fields Modifier and Type Field Description static doubleDEFAULT_MAX_SPEEDDefault maximum speed on a link segmentstatic shortDEFAULT_NUMBER_OF_LANESDefault number of lanesstatic doubleMAXIMUM_DENSITYDefault maximum link density
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description longgetLinkSegmentId()Return id of this instance.doublegetMaximumSpeed(Mode mode)Return the maximum speed along this link for a specified modeintgetNumberOfLanes()Collect the number of lanes of this segmentLinkgetParentLink()Return the parent link of this link segmentbooleanisModeAllowedThroughLink(Mode mode)Returns whether vehicles of a specified mode are allowed through this linkvoidsetMaximumSpeed(Mode mode, double maximumSpeed)Set the maximum speed along this link for a specified modevoidsetNumberOfLanes(int numberOfLanes)Set the number of lanes-
Methods inherited from interface java.lang.Comparable
compareTo
-
Methods inherited from interface org.planit.utils.graph.EdgeSegment
getDownstreamVertex, getExternalId, getId, getParentEdge, getUpstreamVertex, hasExternalId, setExternalId
-
-
-
-
Field Detail
-
DEFAULT_NUMBER_OF_LANES
static final short DEFAULT_NUMBER_OF_LANES
Default number of lanes- See Also:
- Constant Field Values
-
DEFAULT_MAX_SPEED
static final double DEFAULT_MAX_SPEED
Default maximum speed on a link segment- See Also:
- Constant Field Values
-
MAXIMUM_DENSITY
static final double MAXIMUM_DENSITY
Default maximum link density- See Also:
- Constant Field Values
-
-
Method Detail
-
getLinkSegmentId
long getLinkSegmentId()
Return id of this instance. This id is expected to be generated using the org.planit.utils.misc.IdGenerator- Returns:
- link segment id
-
getNumberOfLanes
int getNumberOfLanes()
Collect the number of lanes of this segment- Returns:
- number of lanes
-
setNumberOfLanes
void setNumberOfLanes(int numberOfLanes)
Set the number of lanes- Parameters:
numberOfLanes- to set
-
getMaximumSpeed
double getMaximumSpeed(Mode mode)
Return the maximum speed along this link for a specified mode- Parameters:
mode- the specified mode- Returns:
- maximum speed along this link for the specified mode
-
setMaximumSpeed
void setMaximumSpeed(Mode mode, double maximumSpeed)
Set the maximum speed along this link for a specified mode- Parameters:
mode- the specified modemaximumSpeed- maximum speed along this link for the specified mode
-
getParentLink
Link getParentLink()
Return the parent link of this link segment- Returns:
- Link object which is the parent of this link segment
-
isModeAllowedThroughLink
boolean isModeAllowedThroughLink(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
-
-