Package org.opentrafficsim.road.od
Class OdApplier
java.lang.Object
org.opentrafficsim.road.od.OdApplier
Utility to create vehicle generators on a network from an OD.
Copyright (c) 2013-2024 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
- Author:
- Alexander Verbraeck, Peter Knoppers, Wouter Schakel
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordClass to contain created generator objects. -
Method Summary
Modifier and TypeMethodDescriptionstatic Map<String,OdApplier.GeneratorObjects> applyOd(RoadNetwork network, OdMatrix od, OdOptions odOptions, DetectorType detectorType) Applies the OD to the network by creating vehicle generators.
-
Method Details
-
applyOd
public static Map<String,OdApplier.GeneratorObjects> applyOd(RoadNetwork network, OdMatrix od, OdOptions odOptions, DetectorType detectorType) throws org.opentrafficsim.base.parameters.ParameterException, nl.tudelft.simulation.dsol.SimRuntimeException Applies the OD to the network by creating vehicle generators. The map returned contains objects created for vehicle generation. These are bundled in aGeneratorObjectsand mapped to the vehicle generator id. Vehicle generator id is equal to the origin node id. For lane-based generators the id's are appended with an ordered number (e.g. A1), where the ordering is first by link id, and then right to left concerning the lateral lane position at the start of the lane. For node "A" this would for example be:
If the GTU generation is lane-based (i.e.Generator id Link Lateral start offset A1 AB -1.75m A2 AB 1.75m A3 AC -3.5m A4 AC 0.0m Lanein theCategorization) this method creates aLaneBasedGtuGeneratorper lane. It will have a single source of demand data, specifying demand towards all relevant destinations, and with a uniqueMarkovChainfor the GTU type ifMarkovCorrelationis defined. For zone GTU generation oneLaneBasedGtuGeneratoris created, with one single source of demand data, specifying demand towards all destinations. A singleMarkovChainmay be used. Traffic is distributed over possibleConnectorsbased on their link-weight, or the number of lanes of the connected links if no weight is given.- Parameters:
network- RoadNetwork; networkod- OdMatrix; OD matrixodOptions- OdOptions; options for vehicle generationdetectorType- DetectorType; detector type.- Returns:
- Map<String, GeneratorObjects> map of generator id's and created generator objects mainly for testing
- Throws:
org.opentrafficsim.base.parameters.ParameterException- if a parameter is missingnl.tudelft.simulation.dsol.SimRuntimeException- if this method is called after simulation time 0
-