Class 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
    • 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 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
      • getDirection

        GTUDirectionality getDirection()
        Returns the direction of travel.
        Returns:
        GTUDirectionality; direction of travel
      • speedLimit

        public Speed speedLimit​(GTUType gtuType)
        Parameters:
        gtuType - GTUType; GTU type
        Returns:
        Speed; speed limit