Class Generators


  • public final class Generators
    extends Object
    Generators based on distribution tags for typed scalars.

    Copyright (c) 2003-2020 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. BSD-style license. See OpenTrafficSim License.

    Author:
    Alexander Verbraeck
    • Method Detail

      • makeLengthGenerator

        public static Generator<Length> makeLengthGenerator​(StreamInformation streamInformation,
                                                            LENGTHDISTTYPE lengthDist)
                                                     throws XmlParserException
        Parse a Length distribution into a Generator for Lengths.
        Parameters:
        streamInformation - StreamInformation; the random streams that will be used in the model
        lengthDist - LENGTHDISTTYPE; the tag to parse
        Returns:
        the generator
        Throws:
        XmlParserException - on parse error
      • makePositionGenerator

        public static Generator<Position> makePositionGenerator​(StreamInformation streamInformation,
                                                                POSITIONDISTTYPE positionDist)
                                                         throws XmlParserException
        Parse a Position distribution into a Generator for Positions.
        Parameters:
        streamInformation - StreamInformation; the random streams that will be used in the model
        positionDist - POSITIONDISTTYPE; the tag to parse
        Returns:
        the generator
        Throws:
        XmlParserException - on parse error
      • makeDurationGenerator

        public static Generator<Duration> makeDurationGenerator​(StreamInformation streamInformation,
                                                                DURATIONDISTTYPE durationDist)
                                                         throws XmlParserException
        Parse a Duration distribution into a Generator for Durations.
        Parameters:
        streamInformation - StreamInformation; the random streams that will be used in the model
        durationDist - DURATIONDISTTYPE; the tag to parse
        Returns:
        the generator
        Throws:
        XmlParserException - on parse error
      • makeTimeGenerator

        public static Generator<Time> makeTimeGenerator​(StreamInformation streamInformation,
                                                        TIMEDISTTYPE timeDist)
                                                 throws XmlParserException
        Parse a Time distribution into a Generator for Times.
        Parameters:
        streamInformation - StreamInformation; the random streams that will be used in the model
        timeDist - TIMEDISTTYPE; the tag to parse
        Returns:
        the generator
        Throws:
        XmlParserException - on parse error
      • makeSpeedGenerator

        public static Generator<Speed> makeSpeedGenerator​(StreamInformation streamInformation,
                                                          SPEEDDISTTYPE speedDist)
                                                   throws XmlParserException
        Parse a Speed distribution into a Generator for Speeds.
        Parameters:
        streamInformation - StreamInformation; the random streams that will be used in the model
        speedDist - SPEEDDISTTYPE; the tag to parse
        Returns:
        the generator
        Throws:
        XmlParserException - on parse error
      • makeAccelerationGenerator

        public static Generator<Acceleration> makeAccelerationGenerator​(StreamInformation streamInformation,
                                                                        ACCELERATIONDISTTYPE accelerationDist)
                                                                 throws XmlParserException
        Parse an Acceleration distribution into a Generator for Accelerations.
        Parameters:
        streamInformation - StreamInformation; the random streams that will be used in the model
        accelerationDist - ACCELERATIONDISTTYPE; the tag to parse
        Returns:
        the generator
        Throws:
        XmlParserException - on parse error
      • makeDecelerationGenerator

        public static Generator<Acceleration> makeDecelerationGenerator​(StreamInformation streamInformation,
                                                                        ACCELERATIONDISTTYPE decelerationDist)
                                                                 throws XmlParserException
        Parse an Acceleration distribution into a Generator for Decelerations (acceleration with a minus sign).
        Parameters:
        streamInformation - StreamInformation; the random streams that will be used in the model
        decelerationDist - ACCELERATIONDISTTYPE; the tag to parse
        Returns:
        the generator
        Throws:
        XmlParserException - on parse error