Class GeneratorPositions.LaneBiasDefaults
- java.lang.Object
-
- org.opentrafficsim.road.gtu.generator.GeneratorPositions.LaneBiasDefaults
-
- Enclosing class:
- GeneratorPositions
public static final class GeneratorPositions.LaneBiasDefaults extends Object
Set of lane biases per GTU type enum, based on the GTU Types that are defined by default.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$, $LastChangedDate$, by $Author$, initial version 24 dec. 2017
- Author:
- Alexander Verbraeck, Peter Knoppers, Wouter Schakel
-
-
Constructor Summary
Constructors Constructor Description LaneBiasDefaults()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GeneratorPositions.LaneBiasDefaults
addBias(GTUType.DEFAULTS gtuEnum, GeneratorPositions.LaneBias bias)
Adds a GTU bias for randomly drawing a lane.boolean
contains(GTUType.DEFAULTS gtuEnum)
Whether a bias is defined for the given type.GeneratorPositions.LaneBias
getBias(GTUType.DEFAULTS gtuEnum)
Returns the bias of given GTU type, orBias.None
if none defined for the GTU type.String
toString()
-
-
-
Method Detail
-
addBias
public GeneratorPositions.LaneBiasDefaults addBias(GTUType.DEFAULTS gtuEnum, GeneratorPositions.LaneBias bias)
Adds a GTU bias for randomly drawing a lane.- Parameters:
gtuEnum
- GTUType.DEFAULTS; gtu typebias
- LaneBias; bias- Returns:
- LaneBiases; lane biases for method chaining
-
contains
public boolean contains(GTUType.DEFAULTS gtuEnum)
Whether a bias is defined for the given type.- Parameters:
gtuEnum
- GTUType; GTU type enum- Returns:
- whether a bias is defined for the given type
-
getBias
public GeneratorPositions.LaneBias getBias(GTUType.DEFAULTS gtuEnum)
Returns the bias of given GTU type, orBias.None
if none defined for the GTU type.- Parameters:
gtuEnum
- GTUType.DEFAULTS; GTU type enum- Returns:
- Bias; bias of the GTU type
-
-