Class OdApplier

java.lang.Object
org.opentrafficsim.road.od.OdApplier

public final class OdApplier extends Object
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
  • 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 a GeneratorObjects and 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:
       
      Generator id Link Lateral start offset
      A1 AB -1.75m
      A2 AB 1.75m
      A3 AC -3.5m
      A4 AC 0.0m
      If the GTU generation is lane-based (i.e. Lane in the Categorization) this method creates a LaneBasedGtuGenerator per lane. It will have a single source of demand data, specifying demand towards all relevant destinations, and with a unique MarkovChain for the GTU type if MarkovCorrelation is defined. For zone GTU generation one LaneBasedGtuGenerator is created, with one single source of demand data, specifying demand towards all destinations. A single MarkovChain may be used. Traffic is distributed over possible Connectors based on their link-weight, or the number of lanes of the connected links if no weight is given.
      Parameters:
      network - RoadNetwork; network
      od - OdMatrix; OD matrix
      odOptions - OdOptions; options for vehicle generation
      detectorType - 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 missing
      nl.tudelft.simulation.dsol.SimRuntimeException - if this method is called after simulation time 0