Class ODApplier


  • public final class ODApplier
    extends 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
    • Method Detail

      • applyOD

        public static Map<String,​ODApplier.GeneratorObjects> applyOD​(OTSRoadNetwork network,
                                                                           ODMatrix od,
                                                                           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
        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