Class ODOptions
- java.lang.Object
-
- org.opentrafficsim.road.gtu.generator.od.ODOptions
-
public class ODOptions extends Object
Options for vehicle generation based on an OD matrix.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 6 dec. 2017
- Author:
- Alexander Verbraeck, Peter Knoppers, Wouter Schakel
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ODOptions.Option<K>
Utility class to store options.
-
Field Summary
Fields Modifier and Type Field Description static ODOptions.Option<GTUErrorHandler>
ERROR_HANDLER
Error handler when GTU exceptions occur.static ODOptions.Option<IdGenerator>
GTU_ID
ID generator option.static ODOptions.Option<GTUCharacteristicsGeneratorOD>
GTU_TYPE
GTU characteristics generator option.static ODOptions.Option<ArrivalsHeadwayGenerator.HeadwayDistribution>
HEADWAY_DIST
Headway randomization option.static ODOptions.Option<Boolean>
INSTANT_LC
Whether to perform instantaneous lane changes.static ODOptions.Option<MarkovCorrelation<GTUType,Frequency>>
MARKOV
Markov chain for GTU type option.static ODOptions.Option<Length>
NO_LC_DIST
Initial distance over which lane changes shouldn't be performed option.static ODOptions.Option<LaneBasedGTUGenerator.RoomChecker>
ROOM_CHECKER
Room checker option.
-
Constructor Summary
Constructors Constructor Description ODOptions()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description <K> K
get(ODOptions.Option<K> option, Lane lane, Node node, LinkType linkType)
Get option value.static ODOptions.Option<GeneratorPositions.LaneBiases>
getLaneBiasOption(RoadNetwork network)
Lane bias.<K> ODOptions
set(LinkType linkType, ODOptions.Option<K> option, K value)
Set option value for link type.<K> ODOptions
set(Node node, ODOptions.Option<K> option, K value)
Set option value for node.<K> ODOptions
set(ODOptions.Option<K> option, K value)
Set option value.<K> ODOptions
set(Lane lane, ODOptions.Option<K> option, K value)
Set option value for lane.
-
-
-
Field Detail
-
HEADWAY_DIST
public static final ODOptions.Option<ArrivalsHeadwayGenerator.HeadwayDistribution> HEADWAY_DIST
Headway randomization option.
-
GTU_ID
public static final ODOptions.Option<IdGenerator> GTU_ID
ID generator option.
-
GTU_TYPE
public static final ODOptions.Option<GTUCharacteristicsGeneratorOD> GTU_TYPE
GTU characteristics generator option.
-
ROOM_CHECKER
public static final ODOptions.Option<LaneBasedGTUGenerator.RoomChecker> ROOM_CHECKER
Room checker option.
-
MARKOV
public static final ODOptions.Option<MarkovCorrelation<GTUType,Frequency>> MARKOV
Markov chain for GTU type option.
-
NO_LC_DIST
public static final ODOptions.Option<Length> NO_LC_DIST
Initial distance over which lane changes shouldn't be performed option.
-
INSTANT_LC
public static final ODOptions.Option<Boolean> INSTANT_LC
Whether to perform instantaneous lane changes.
-
ERROR_HANDLER
public static final ODOptions.Option<GTUErrorHandler> ERROR_HANDLER
Error handler when GTU exceptions occur.
-
-
Method Detail
-
getLaneBiasOption
public static final ODOptions.Option<GeneratorPositions.LaneBiases> getLaneBiasOption(RoadNetwork network)
Lane bias. Default is Truck: truck right (strong right, max 2 lanes), Vehicle (other): weak left.- Parameters:
network
- the network for which to return the lane bias- Returns:
- the lane bias
-
set
public final <K> ODOptions set(ODOptions.Option<K> option, K value)
Set option value.- Type Parameters:
K
- value type- Parameters:
option
- Option<K>; optionvalue
- K; option value- Returns:
- this option set
-
set
public final <K> ODOptions set(Lane lane, ODOptions.Option<K> option, K value)
Set option value for lane.- Type Parameters:
K
- value type- Parameters:
lane
- Lane; laneoption
- Option<K>; optionvalue
- K; option value- Returns:
- this option set
-
set
public final <K> ODOptions set(Node node, ODOptions.Option<K> option, K value)
Set option value for node.- Type Parameters:
K
- value type- Parameters:
node
- Node; nodeoption
- Option<K>; optionvalue
- K; option value- Returns:
- this option set
-
set
public final <K> ODOptions set(LinkType linkType, ODOptions.Option<K> option, K value)
Set option value for link type.- Type Parameters:
K
- value type- Parameters:
linkType
- LinkType; link typeoption
- Option<K>; optionvalue
- K; option value- Returns:
- this option set
-
get
public final <K> K get(ODOptions.Option<K> option, Lane lane, Node node, LinkType linkType)
Get option value. If a value is specified for a specific category, it is returned. The following order is used:Lane
Node
(origin)LinkType
- None (global option value)
- Default option value
- Type Parameters:
K
- value type- Parameters:
option
- Option<K>; optionlane
- Lane; lane to obtain specific option value, may be nullnode
- Node; node to obtain specific option value, may be nulllinkType
- LinkType; link type to obtain specific option value, may be null- Returns:
- K; option value
-
-