Class ParseDistribution
- java.lang.Object
-
- org.opentrafficsim.road.network.factory.xml.utils.ParseDistribution
-
public final class ParseDistribution extends Object
Parse a distribution from text to a distribution.Copyright (c) 2013-2020 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
$LastChangedDate: 2015-07-24 02:58:59 +0200 (Fri, 24 Jul 2015) $, @version $Revision: 1147 $, by $Author: averbraeck $, initial version Jul 23, 2015
BSD-style license. See OpenTrafficSim License.- Author:
- Alexander Verbraeck
-
-
Method Summary
-
-
-
Method Detail
-
makeDistDiscrete
public static DistDiscrete makeDistDiscrete(StreamInformation streamInformation, DISCRETEDISTTYPE distType) throws XmlParserException
Parse a discrete distribution.- Parameters:
streamInformation- StreamInformation; the random streams that will be used in the modeldistType- DISCRETEDISTTYPE; the distribution to parse- Returns:
- the generated distribution.
- Throws:
XmlParserException- in case distribution unknown or parameter number does not match.
-
makeDistContinuous
public static DistContinuous makeDistContinuous(StreamInformation streamInformation, CONTDISTTYPE distType) throws XmlParserException
Parse a continuous distribution.- Parameters:
streamInformation- StreamInformation; the random streams that will be used in the modeldistType- CONTDISTTYPE; the distribution to parse- Returns:
- the generated distribution.
- Throws:
XmlParserException- in case distribution unknown or parameter number does not match.
-
parseLengthDist
public static ContinuousDistDoubleScalar.Rel<Length,LengthUnit> parseLengthDist(StreamInformation streamInformation, LENGTHDISTTYPE lengthDist) throws XmlParserException
Parse a relative length distribution, e.g.UNIFORM(1, 3) m.- Parameters:
streamInformation- StreamInformation; the random streams that will be used in the modellengthDist- LENGTHDISTTYPE; the tag to parse- Returns:
- a typed continuous random distribution.
- Throws:
XmlParserException- in case of a parse error.
-
parsePositionDist
public static ContinuousDistDoubleScalar.Abs<Position,PositionUnit,LengthUnit> parsePositionDist(StreamInformation streamInformation, POSITIONDISTTYPE positionDist) throws XmlParserException
Parse an absolute position distribution, e.g.UNIFORM(1, 3) m.- Parameters:
streamInformation- StreamInformation; the random streams that will be used in the modelpositionDist- POSITIONDISTTYPE; the tag to parse- Returns:
- a typed continuous random distribution.
- Throws:
XmlParserException- in case of a parse error.
-
parseDurationDist
public static ContinuousDistDoubleScalar.Rel<Duration,DurationUnit> parseDurationDist(StreamInformation streamInformation, DURATIONDISTTYPE durationDist) throws XmlParserException
Parse a relative duration distribution, e.g.UNIFORM(1, 3) s.- Parameters:
streamInformation- StreamInformation; the random streams that will be used in the modeldurationDist- DURATIONDISTTYPE; the tag to parse- Returns:
- a typed continuous random distribution.
- Throws:
XmlParserException- in case of a parse error.
-
parseTimeDist
public static ContinuousDistDoubleScalar.Abs<Time,TimeUnit,DurationUnit> parseTimeDist(StreamInformation streamInformation, TIMEDISTTYPE timeDist) throws XmlParserException
Parse an absolute time distribution, e.g.UNIFORM(1, 3) s.- Parameters:
streamInformation- StreamInformation; the random streams that will be used in the modeltimeDist- TIMEDISTTYPE; the tag to parse- Returns:
- a typed continuous random distribution.
- Throws:
XmlParserException- in case of a parse error.
-
parseSpeedDist
public static ContinuousDistDoubleScalar.Rel<Speed,SpeedUnit> parseSpeedDist(StreamInformation streamInformation, SPEEDDISTTYPE speedDist) throws XmlParserException
Parse a relative speed distribution, e.g.UNIFORM(1, 3) m/s.- Parameters:
streamInformation- StreamInformation; the random streams that will be used in the modelspeedDist- SPEEDDISTTYPE; the tag to parse- Returns:
- a typed continuous random distribution.
- Throws:
XmlParserException- in case of a parse error.
-
parseAccelerationDist
public static ContinuousDistDoubleScalar.Rel<Acceleration,AccelerationUnit> parseAccelerationDist(StreamInformation streamInformation, ACCELERATIONDISTTYPE accelerationDist) throws XmlParserException
Parse a relative acceleration distribution, e.g.UNIFORM(1, 3) s.- Parameters:
streamInformation- StreamInformation; the random streams that will be used in the modelaccelerationDist- ACCELERATIONDISTTYPE; the tag to parse- Returns:
- a typed continuous random distribution.
- Throws:
XmlParserException- in case of a parse error.
-
parseFrequencyDist
public static ContinuousDistDoubleScalar.Rel<Frequency,FrequencyUnit> parseFrequencyDist(StreamInformation streamInformation, FREQUENCYDISTTYPE frequencyDist) throws XmlParserException
Parse a relative frequency distribution, e.g.UNIFORM(1, 3) s.- Parameters:
streamInformation- StreamInformation; the random streams that will be used in the modelfrequencyDist- FREQUENCYDISTTYPE; the tag to parse- Returns:
- a typed continuous random distribution.
- Throws:
XmlParserException- in case of a parse error.
-
parseLinearDensityDist
public static ContinuousDistDoubleScalar.Rel<LinearDensity,LinearDensityUnit> parseLinearDensityDist(StreamInformation streamInformation, LINEARDENSITYDISTTYPE linearDensityDist) throws XmlParserException
Parse a relative linear density distribution, e.g.UNIFORM(1, 3) s.- Parameters:
streamInformation- StreamInformation; the random streams that will be used in the modellinearDensityDist- LINEARDENSITYDISTTYPE; the tag to parse- Returns:
- a typed continuous random distribution.
- Throws:
XmlParserException- in case of a parse error.
-
-