Class GeneratorPositions.GeneratorLinkPosition
java.lang.Object
org.opentrafficsim.road.gtu.generator.GeneratorPositions.GeneratorLinkPosition
- Enclosing interface:
- GeneratorPositions
Class representing a vehicle generation link to provide individual generation positions.
Copyright (c) 2013-2024 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
- Author:
- Alexander Verbraeck, Peter Knoppers, Wouter Schakel
-
Constructor Summary
ConstructorDescriptionGeneratorLinkPosition
(List<GeneratorPositions.GeneratorLanePosition> positions, Link link, nl.tudelft.simulation.jstats.streams.StreamInterface stream, GeneratorPositions.LaneBiases laneBiases) Constructor.GeneratorLinkPosition
(List<GeneratorPositions.GeneratorLanePosition> positions, Link link, nl.tudelft.simulation.jstats.streams.StreamInterface stream, GeneratorPositions.LaneBiases laneBiases, double weight, Node viaNode) Constructor. -
Method Summary
Modifier and TypeMethodDescription(package private) GeneratorPositions.GeneratorLanePosition
draw
(GtuType gtuType, Map<Integer, Integer> unplaced, org.djunits.value.vdouble.scalar.Speed desiredSpeed) Draws a specific GeneratorLanePosition utilizing lane biases of GTU types.(package private) Link
getLink()
Return the link.(package private) int
getNumberOfLanes
(GtuType gtuType) Returns the number of accessible lanes for the GTU type.(package private) Node
Returns the node by which a connector connects.(package private) double
Returns the weight for this link.org.djunits.value.vdouble.scalar.Speed
speedLimit
(GtuType gtuType) toString()
-
Constructor Details
-
GeneratorLinkPosition
GeneratorLinkPosition(List<GeneratorPositions.GeneratorLanePosition> positions, Link link, nl.tudelft.simulation.jstats.streams.StreamInterface stream, GeneratorPositions.LaneBiases laneBiases) Constructor.- Parameters:
positions
- List<GeneratorLanePosition>; contained laneslink
- Link; the linkstream
- StreamInterface; streamlaneBiases
- LaneBiases; lane biases
-
GeneratorLinkPosition
GeneratorLinkPosition(List<GeneratorPositions.GeneratorLanePosition> positions, Link link, nl.tudelft.simulation.jstats.streams.StreamInterface stream, GeneratorPositions.LaneBiases laneBiases, double weight, Node viaNode) Constructor.- Parameters:
positions
- List<GeneratorLanePosition>; contained laneslink
- Link; the linkstream
- StreamInterface; streamlaneBiases
- LaneBiases; lane biasesweight
- double; weight for drawing this linkviaNode
- Node; node by which a connector connects
-
-
Method Details
-
getLink
Link getLink()Return the link.- Returns:
- CrossSectionLink; link
-
getWeight
Returns the weight for this link. This is either a predefined weight, or the number of lanes for the GTU type.- Parameters:
gtuType
- GtuType; GTU type- Returns:
- double; weight for this link
-
getViaNode
Node getViaNode()Returns the node by which a connector connects.- Returns:
- the node by which a connector connects
-
getNumberOfLanes
Returns the number of accessible lanes for the GTU type.- Parameters:
gtuType
- GtuType; GTU type- Returns:
- int; number of accessible lanes for the GTU type
-
draw
GeneratorPositions.GeneratorLanePosition draw(GtuType gtuType, Map<Integer, Integer> unplaced, org.djunits.value.vdouble.scalar.Speed desiredSpeed) Draws a specific GeneratorLanePosition utilizing lane biases of GTU types.- Parameters:
gtuType
- GtuType; GTU typeunplaced
- Map<Integer, Integer>; number of unplaced GTUs per lane. The lane number should match withGeneratorLanePosition.getLaneNumber()
, where 1 is the right-most lane. Missing lanes are assumed to have no queue.desiredSpeed
- Speed; desired speed, possibly used to determine the biased road position- Returns:
- GeneratorLanePosition; specific GeneratorLanePosition utilizing lane biases of GTU types
-
toString
-
speedLimit
- Parameters:
gtuType
- GtuType; GTU type- Returns:
- Speed; speed limit
-