Class Generators
- java.lang.Object
-
- org.opentrafficsim.road.network.factory.xml.utils.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 Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Generator<Acceleration>makeAccelerationGenerator(StreamInformation streamInformation, ACCELERATIONDISTTYPE accelerationDist)Parse an Acceleration distribution into a Generator for Accelerations.static Generator<Acceleration>makeDecelerationGenerator(StreamInformation streamInformation, ACCELERATIONDISTTYPE decelerationDist)Parse an Acceleration distribution into a Generator for Decelerations (acceleration with a minus sign).static Generator<Duration>makeDurationGenerator(StreamInformation streamInformation, DURATIONDISTTYPE durationDist)Parse a Duration distribution into a Generator for Durations.static Generator<Length>makeLengthGenerator(StreamInformation streamInformation, LENGTHDISTTYPE lengthDist)Parse a Length distribution into a Generator for Lengths.static Generator<Position>makePositionGenerator(StreamInformation streamInformation, POSITIONDISTTYPE positionDist)Parse a Position distribution into a Generator for Positions.static Generator<Speed>makeSpeedGenerator(StreamInformation streamInformation, SPEEDDISTTYPE speedDist)Parse a Speed distribution into a Generator for Speeds.static Generator<Time>makeTimeGenerator(StreamInformation streamInformation, TIMEDISTTYPE timeDist)Parse a Time distribution into a Generator for Times.
-
-
-
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 modellengthDist- 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 modelpositionDist- 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 modeldurationDist- 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 modeltimeDist- 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 modelspeedDist- 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 modelaccelerationDist- 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 modeldecelerationDist- ACCELERATIONDISTTYPE; the tag to parse- Returns:
- the generator
- Throws:
XmlParserException- on parse error
-
-