Class ODOptions


  • public class ODOptions
    extends Object
    Options for vehicle generation based on an OD matrix.

    Copyright (c) 2013-2022 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
    • Constructor Detail

      • ODOptions

        public ODOptions()
    • 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>; option
        value - 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; lane
        option - Option<K>; option
        value - 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; node
        option - Option<K>; option
        value - 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 type
        option - Option<K>; option
        value - 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>; option
        lane - Lane; lane to obtain specific option value, may be null
        node - Node; node to obtain specific option value, may be null
        linkType - LinkType; link type to obtain specific option value, may be null
        Returns:
        K; option value