Class DiscreteDistDoubleScalar.Rel<T extends AbstractDoubleScalarRel<U,T>,U extends Unit<U>>
- java.lang.Object
-
- org.opentrafficsim.core.units.distributions.AbstractDiscreteDistScalar
-
- org.opentrafficsim.core.units.distributions.DiscreteDistDoubleScalar.Rel<T,U>
-
- Type Parameters:
T- The absolute doublescalar typeU- The unit type used
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
DiscreteDistAcceleration,DiscreteDistAngle,DiscreteDistArea,DiscreteDistDensity,DiscreteDistDimensionless,DiscreteDistDuration,DiscreteDistElectricalCharge,DiscreteDistElectricalCurrent,DiscreteDistElectricalPotential,DiscreteDistElectricalResistance,DiscreteDistEnergy,DiscreteDistFlowMass,DiscreteDistForce,DiscreteDistFrequency,DiscreteDistLength,DiscreteDistLinearDensity,DiscreteDistMass,DiscreteDistPower,DiscreteDistPressure,DiscreteDistSolidAngle,DiscreteDistSpeed,DiscreteDistTemperature,DiscreteDistTorque,DiscreteDistVolume
- Enclosing interface:
- DiscreteDistDoubleScalar
public static class DiscreteDistDoubleScalar.Rel<T extends AbstractDoubleScalarRel<U,T>,U extends Unit<U>> extends AbstractDiscreteDistScalar implements Serializable
Relative value.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Rel(long constant, U unit)Construct a new DistDiscreteDoubleScalar.Rel that always draws the same, fixed, value.Rel(DistDiscrete distribution, U unit)Construct a new DistDiscreteDoubleScalar.Rel.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Tdraw()Draw one value from this DistDiscreteDoubleScalar.Rel.StringtoString()-
Methods inherited from class org.opentrafficsim.core.units.distributions.AbstractDiscreteDistScalar
getDistribution, getUnit
-
-
-
-
Constructor Detail
-
Rel
public Rel(DistDiscrete distribution, U unit)
Construct a new DistDiscreteDoubleScalar.Rel.- Parameters:
distribution- DistDiscrete; the wrapped distribution functionunit- U; the realtive unit
-
Rel
public Rel(long constant, U unit)Construct a new DistDiscreteDoubleScalar.Rel that always draws the same, fixed, value.- Parameters:
constant- long; the constant value.unit- U; the relative unit.
-
-
Method Detail
-
draw
public T draw()
Draw one value from this DistDiscreteDoubleScalar.Rel.- Returns:
- T; a value drawn from the distribution in the given unit.
-
toString
public String toString()
- Overrides:
toStringin classAbstractDiscreteDistScalar
-
-