Class ParseDistribution
- java.lang.Object
-
- org.opentrafficsim.road.network.factory.xml.utils.ParseDistribution
-
public final class ParseDistribution extends java.lang.ObjectParse 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
All Methods Static Methods Concrete Methods Modifier and Type Method Description static DistContinuousmakeDistContinuous(java.util.Map<java.lang.String,StreamInformation> streamMap, CONTDISTTYPE distType)Parse a continuous distribution.static DistDiscretemakeDistDiscrete(java.util.Map<java.lang.String,StreamInformation> streamMap, DISCRETEDISTTYPE distType)Parse a discrete distribution.static ContinuousDistDoubleScalar.Rel<Acceleration,AccelerationUnit>parseAccelerationDist(java.util.Map<java.lang.String,StreamInformation> streamMap, ACCELERATIONDISTTYPE accelerationDist)Parse a relative acceleration distribution, e.g.static ContinuousDistDoubleScalar.Rel<Duration,DurationUnit>parseDurationDist(java.util.Map<java.lang.String,StreamInformation> streamMap, DURATIONDISTTYPE durationDist)Parse a relative duration distribution, e.g.static ContinuousDistDoubleScalar.Rel<Frequency,FrequencyUnit>parseFrequencyDist(java.util.Map<java.lang.String,StreamInformation> streamMap, FREQUENCYDISTTYPE frequencyDist)Parse a relative frequency distribution, e.g.static ContinuousDistDoubleScalar.Rel<Length,LengthUnit>parseLengthDist(java.util.Map<java.lang.String,StreamInformation> streamMap, LENGTHDISTTYPE lengthDist)Parse a relative length distribution, e.g.static ContinuousDistDoubleScalar.Rel<LinearDensity,LinearDensityUnit>parseLinearDensityDist(java.util.Map<java.lang.String,StreamInformation> streamMap, LINEARDENSITYDISTTYPE linearDensityDist)Parse a relative linear density distribution, e.g.static ContinuousDistDoubleScalar.Abs<Position,PositionUnit,LengthUnit>parsePositionDist(java.util.Map<java.lang.String,StreamInformation> streamMap, POSITIONDISTTYPE positionDist)Parse an absolute position distribution, e.g.static ContinuousDistDoubleScalar.Rel<Speed,SpeedUnit>parseSpeedDist(java.util.Map<java.lang.String,StreamInformation> streamMap, SPEEDDISTTYPE speedDist)Parse a relative speed distribution, e.g.static ContinuousDistDoubleScalar.Abs<Time,TimeUnit,DurationUnit>parseTimeDist(java.util.Map<java.lang.String,StreamInformation> streamMap, TIMEDISTTYPE timeDist)Parse an absolute time distribution, e.g.
-
-
-
Method Detail
-
makeDistDiscrete
public static DistDiscrete makeDistDiscrete(java.util.Map<java.lang.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(java.util.Map<java.lang.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(java.util.Map<java.lang.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(java.util.Map<java.lang.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(java.util.Map<java.lang.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(java.util.Map<java.lang.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(java.util.Map<java.lang.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(java.util.Map<java.lang.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(java.util.Map<java.lang.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(java.util.Map<java.lang.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.
-
-