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.
BSD-style license. See OpenTrafficSim License.$LastChangedDate: 2015-07-24 02:58:59 +0200 (Fri, 24 Jul 2015) $, @version $Revision: 1147 $, by $Author: averbraeck $, initial version Jul 23, 2015
- Author:
- Alexander Verbraeck
-
-
Method Summary
-
-
-
Method Detail
-
makeDistDiscrete
public static DistDiscrete makeDistDiscrete(Map<String,StreamInformation> streamMap, DISCRETEDISTTYPE distType) throws XmlParserException
Parse a discrete distribution.- Parameters:
streamMap- map with stream informationdistType- 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(Map<String,StreamInformation> streamMap, CONTDISTTYPE distType) throws XmlParserException
Parse a continuous distribution.- Parameters:
streamMap- map with stream informationdistType- 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(Map<String,StreamInformation> streamMap, LENGTHDISTTYPE lengthDist) throws XmlParserException
Parse a relative length distribution, e.g.UNIFORM(1, 3) m.- Parameters:
streamMap- the map with streams from the RUN taglengthDist- 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(Map<String,StreamInformation> streamMap, POSITIONDISTTYPE positionDist) throws XmlParserException
Parse an absolute position distribution, e.g.UNIFORM(1, 3) m.- Parameters:
streamMap- the map with streams from the RUN tagpositionDist- 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(Map<String,StreamInformation> streamMap, DURATIONDISTTYPE durationDist) throws XmlParserException
Parse a relative duration distribution, e.g.UNIFORM(1, 3) s.- Parameters:
streamMap- the map with streams from the RUN tagdurationDist- 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(Map<String,StreamInformation> streamMap, TIMEDISTTYPE timeDist) throws XmlParserException
Parse an absolute time distribution, e.g.UNIFORM(1, 3) s.- Parameters:
streamMap- the map with streams from the RUN tagtimeDist- 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(Map<String,StreamInformation> streamMap, SPEEDDISTTYPE speedDist) throws XmlParserException
Parse a relative speed distribution, e.g.UNIFORM(1, 3) m/s.- Parameters:
streamMap- the map with streams from the RUN tagspeedDist- 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(Map<String,StreamInformation> streamMap, ACCELERATIONDISTTYPE accelerationDist) throws XmlParserException
Parse a relative acceleration distribution, e.g.UNIFORM(1, 3) s.- Parameters:
streamMap- the map with streams from the RUN tagaccelerationDist- 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(Map<String,StreamInformation> streamMap, FREQUENCYDISTTYPE frequencyDist) throws XmlParserException
Parse a relative frequency distribution, e.g.UNIFORM(1, 3) s.- Parameters:
streamMap- the map with streams from the RUN tagfrequencyDist- 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(Map<String,StreamInformation> streamMap, LINEARDENSITYDISTTYPE linearDensityDist) throws XmlParserException
Parse a relative linear density distribution, e.g.UNIFORM(1, 3) s.- Parameters:
streamMap- the map with streams from the RUN taglinearDensityDist- the tag to parse- Returns:
- a typed continuous random distribution.
- Throws:
XmlParserException- in case of a parse error.
-
-