Class GeneratorPositions.GeneratorLinkPosition
- java.lang.Object
-
- org.opentrafficsim.road.gtu.generator.GeneratorPositions.GeneratorLinkPosition
-
- Enclosing class:
- GeneratorPositions
public static final class GeneratorPositions.GeneratorLinkPosition extends Object
Class representing a vehicle generation link to provide individual generation positions.Copyright (c) 2013-2022 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.- Version:
- $Revision$, $LastChangedDate$, by $Author$, initial version 23 dec. 2017
- Author:
- Alexander Verbraeck, Peter Knoppers, Wouter Schakel
-
-
Constructor Summary
Constructors Constructor Description GeneratorLinkPosition(List<GeneratorPositions.GeneratorLanePosition> positions, CrossSectionLink link, StreamInterface stream, GeneratorPositions.LaneBiases laneBiases)
Constructor.GeneratorLinkPosition(List<GeneratorPositions.GeneratorLanePosition> positions, CrossSectionLink link, StreamInterface stream, GeneratorPositions.LaneBiases laneBiases, double weight, Node viaNode)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) GeneratorPositions.GeneratorLanePosition
draw(GTUType gtuType, Map<Integer,Integer> unplaced, Speed desiredSpeed)
Draws a specific GeneratorLanePosition utilizing lane biases of GTU types.(package private) GTUDirectionality
getDirection()
Returns the direction of travel.(package private) CrossSectionLink
getLink()
Return the link.(package private) int
getNumberOfLanes(GTUType gtuType)
Returns the number of accessible lanes for the GTU type.(package private) Node
getViaNode()
Returns the node by which a connector connects.(package private) double
getWeight(GTUType gtuType)
Returns the weight for this link.Speed
speedLimit(GTUType gtuType)
String
toString()
-
-
-
Constructor Detail
-
GeneratorLinkPosition
GeneratorLinkPosition(List<GeneratorPositions.GeneratorLanePosition> positions, CrossSectionLink link, StreamInterface stream, GeneratorPositions.LaneBiases laneBiases)
Constructor.- Parameters:
positions
- List<GeneratorLanePosition>; contained laneslink
- CrossSectionLink; the linkstream
- StreamInterface; streamlaneBiases
- LaneBiases; lane biases
-
GeneratorLinkPosition
GeneratorLinkPosition(List<GeneratorPositions.GeneratorLanePosition> positions, CrossSectionLink link, StreamInterface stream, GeneratorPositions.LaneBiases laneBiases, double weight, Node viaNode)
Constructor.- Parameters:
positions
- List<GeneratorLanePosition>; contained laneslink
- CrossSectionLink; the linkstream
- StreamInterface; streamlaneBiases
- LaneBiases; lane biasesweight
- double; weight for drawing this linkviaNode
- Node; node by which a connector connects
-
-
Method Detail
-
getLink
CrossSectionLink getLink()
Return the link.- Returns:
- CrossSectionLink; link
-
getWeight
double getWeight(GTUType gtuType)
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
int getNumberOfLanes(GTUType gtuType)
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, 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
-
getDirection
GTUDirectionality getDirection()
Returns the direction of travel.- Returns:
- GTUDirectionality; direction of travel
-
-