Class DiscreteDistFloatScalar.Rel<T extends AbstractFloatScalarRel<U,T>,U extends Unit<U>>
- java.lang.Object
-
- org.opentrafficsim.core.units.distributions.AbstractDiscreteDistScalar
-
- org.opentrafficsim.core.units.distributions.DiscreteDistFloatScalar.Rel<T,U>
-
- Type Parameters:
T- The absolute float scalar typeU- The unit type used
- All Implemented Interfaces:
Serializable
- Enclosing interface:
- DiscreteDistFloatScalar
public static class DiscreteDistFloatScalar.Rel<T extends AbstractFloatScalarRel<U,T>,U extends Unit<U>> extends AbstractDiscreteDistScalar implements Serializable
Relative value.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Rel(int constant, U unit)Construct a new DiscreteDistFloatScalar.Rel that always draws the same, fixed, value.Rel(DistDiscrete distribution, U unit)Construct a new DiscreteDistFloatScalar.Rel.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Tdraw()Draw a value from this DiscreteDistFloatScalar.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 DiscreteDistFloatScalar.Rel.- Parameters:
distribution- DistDiscrete; the wrapped distribution function.unit- U; the relative unit.
-
Rel
public Rel(int constant, U unit)Construct a new DiscreteDistFloatScalar.Rel that always draws the same, fixed, value.- Parameters:
constant- int; the constant value.unit- U; the relative unit.
-
-
Method Detail
-
draw
public final T draw()
Draw a value from this DiscreteDistFloatScalar.Rel.- Returns:
- T; a value drawn from the distribution in the given unit.
-
toString
public final String toString()
- Overrides:
toStringin classAbstractDiscreteDistScalar
-
-