Class GTUType

All Implemented Interfaces:
Serializable, Identifiable

public final class GTUType
extends HierarchicalType<GTUType>
implements Serializable
A GTU type identifies the type of a GTU.
GTU types are used to check whether a particular GTU can travel over a particular part of infrastructure. E.g. a (LaneBased)GTU with GTUType CAR can travel over lanes that have a LaneType that has the GTUType CAR in the compatibility set.

Copyright (c) 2013-2019 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.

Version:
$Revision: 5717 $, $LastChangedDate: 2019-11-14 14:36:06 +0100 (Thu, 14 Nov 2019) $, by $Author: averbraeck $, initial version Dec 31, 2014
Author:
Alexander Verbraeck, Peter Knoppers
See Also:
Serialized Form
  • Constructor Details

  • Method Details

    • isOfType

      public boolean isOfType​(GTUType.DEFAULTS type)
      Whether this, or any of the parent types, equals the given type.
      Parameters:
      type - DEFAULTS; type
      Returns:
      whether this, or any of the parent types, equals the given type
    • isType

      public boolean isType​(GTUType.DEFAULTS type)
      Whether this equals the given type.
      Parameters:
      type - DEFAULTS; type
      Returns:
      whether this equals the given type
    • defaultCharacteristics

      public static GTUCharacteristics defaultCharacteristics​(GTUType gtuType, Network network, StreamInterface randomStream) throws GTUException
      Returns default characteristics for given GTUType.
      Parameters:
      gtuType - GTUType; GTUType GTU type
      network - Network; the network to use as a key
      randomStream - StreamInterface; stream for random numbers
      Returns:
      default characteristics for given GTUType
      Throws:
      GTUException - if there are no default characteristics for the GTU type
    • getNetwork

      public Network getNetwork()
      Returns:
      the network to which the GTUType belongs
    • toString

      public String toString()
      Overrides:
      toString in class Object