Package org.opentrafficsim.core.gtu
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.
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-2020 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
- Version:
- $Revision: 6010 $, $LastChangedDate: 2020-01-23 11:14:19 +0100 (Thu, 23 Jan 2020) $, by $Author: averbraeck $,
initial version Dec 31, 2014
- Author:
- Alexander Verbraeck, Peter Knoppers
- See Also:
- Serialized Form
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classGTUType.DEFAULTSDefault types with their name. -
Constructor Summary
-
Method Summary
Modifier and Type Method Description static GTUCharacteristicsdefaultCharacteristics(GTUType gtuType, Network network, StreamInterface randomStream)Returns default characteristics for given GTUType.NetworkgetNetwork()booleanisOfType(GTUType.DEFAULTS type)Whether this, or any of the parent types, equals the given type.booleanisType(GTUType.DEFAULTS type)Whether this equals the given type.StringtoString()Methods inherited from class org.opentrafficsim.base.HierarchicalType
commonAncestor, equals, getId, getParent, hashCode, isOfType
-
Constructor Details
-
GTUType
- Parameters:
id- String; The id of the GTUType to make it identifiable.network- Network; The network to which the GTUType belongs- Throws:
NullPointerException- if the id is null
-
GTUType
- Parameters:
id- String; The id of the GTUType to make it identifiable.parent- GTUType; parent GTU type- Throws:
NullPointerException- if the id is null
-
-
Method Details
-
isOfType
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
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 GTUExceptionReturns default characteristics for given GTUType.- Parameters:
gtuType- GTUType; GTUType GTU typenetwork- Network; the network to use as a keyrandomStream- StreamInterface; stream for random numbers- Returns:
- default characteristics for given GTUType
- Throws:
GTUException- if there are no default characteristics for the GTU type
-
getNetwork
- Returns:
- the network to which the GTUType belongs
-
toString
-