Class ODApplier

java.lang.Object
org.opentrafficsim.road.gtu.generator.od.ODApplier

public final class ODApplier
extends java.lang.Object
Utility to create vehicle generators on a network from an OD.

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 30 nov. 2017
Author:
Alexander Verbraeck, Peter Knoppers, Wouter Schakel
  • Nested Class Summary

    Nested Classes 
    Modifier and Type Class Description
    static class  ODApplier.GeneratorObjects
    Class to contain created generator objects.
  • Method Summary

    Modifier and Type Method Description
    static java.util.Map<java.lang.String,​ODApplier.GeneratorObjects> applyOD​(OTSRoadNetwork network, ODMatrix od, OTSSimulatorInterface simulator, ODOptions odOptions)
    Applies the OD to the network by creating vehicle generators.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • applyOD

      public static java.util.Map<java.lang.String,​ODApplier.GeneratorObjects> applyOD​(OTSRoadNetwork network, ODMatrix od, OTSSimulatorInterface simulator, ODOptions odOptions) throws ParameterException, 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
      Parameters:
      network - OTSRoadNetwork; network
      od - ODMatrix; OD matrix
      simulator - OTSSimulatorInterface; simulator
      odOptions - ODOptions; options for vehicle generation
      Returns:
      Map<String, GeneratorObjects> map of generator id's and created generator objects mainly for testing
      Throws:
      ParameterException - if a parameter is missing
      SimRuntimeException - if this method is called after simulation time 0