Class GeneratorPositions.GeneratorLinkPosition

java.lang.Object
org.opentrafficsim.road.gtu.generator.GeneratorPositions.GeneratorLinkPosition
Enclosing interface:
GeneratorPositions

public static final class GeneratorPositions.GeneratorLinkPosition extends Object
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 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 lanes
      link - Link; the link
      stream - StreamInterface; stream
      laneBiases - 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 lanes
      link - Link; the link
      stream - StreamInterface; stream
      laneBiases - LaneBiases; lane biases
      weight - double; weight for drawing this link
      viaNode - Node; node by which a connector connects
  • Method Details

    • getLink

      Link 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, org.djunits.value.vdouble.scalar.Speed desiredSpeed)
      Draws a specific GeneratorLanePosition utilizing lane biases of GTU types.
      Parameters:
      gtuType - GtuType; GTU type
      unplaced - Map<Integer, Integer>; number of unplaced GTUs per lane. The lane number should match with GeneratorLanePosition.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

      public String toString()
      Overrides:
      toString in class Object
    • speedLimit

      public org.djunits.value.vdouble.scalar.Speed speedLimit(GtuType gtuType)
      Parameters:
      gtuType - GtuType; GTU type
      Returns:
      Speed; speed limit