Package org.ojalgo.random
Class RandomNumber
java.lang.Object
org.ojalgo.random.RandomNumber
- All Implemented Interfaces:
Comparable<RandomNumber>
,DoubleSupplier
,Supplier<Double>
,BasicFunction
,NullaryFunction<Double>
,PrimitiveFunction.Nullary
,Distribution
,AccessScalar<Double>
,ComparableNumber<RandomNumber>
,NumberDefinition
- Direct Known Subclasses:
AbstractContinuous
,AbstractDiscrete
,Deterministic
,Erlang
,Gamma
,Weibull
public abstract class RandomNumber
extends Object
implements Distribution, PrimitiveFunction.Nullary, ComparableNumber<RandomNumber>
RandomNumber
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.ojalgo.function.BasicFunction
BasicFunction.Differentiable<N extends Comparable<N>,
F extends BasicFunction>, BasicFunction.Integratable<N extends Comparable<N>, F extends BasicFunction>, BasicFunction.PlainUnary<T, R> -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
checkProbabilty
(double probabilty) int
final double
final float
protected abstract double
generate()
double
Subclasses must override either getStandardDeviation() or getVariance()!double
Subclasses must override either getStandardDeviation() or getVariance()!final int
intValue()
final Double
invoke()
final long
newSampleSet
(int numberOfSamples) protected final Random
random()
void
void
setSeed
(long seed) toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.ojalgo.random.Distribution
getExpected
Methods inherited from interface org.ojalgo.function.NullaryFunction
andThen, get, getAsDouble
Methods inherited from interface org.ojalgo.type.NumberDefinition
booleanValue, byteValue, shortValue
-
Field Details
-
myRandom
-
-
Constructor Details
-
RandomNumber
protected RandomNumber()
-
-
Method Details
-
compareTo
- Specified by:
compareTo
in interfaceComparable<RandomNumber>
-
doubleValue
public final double doubleValue()- Specified by:
doubleValue
in interfaceNullaryFunction<Double>
- Specified by:
doubleValue
in interfaceNumberDefinition
-
floatValue
public final float floatValue()- Specified by:
floatValue
in interfaceNumberDefinition
-
getStandardDeviation
public double getStandardDeviation()Subclasses must override either getStandardDeviation() or getVariance()!- Specified by:
getStandardDeviation
in interfaceDistribution
- See Also:
-
getVariance
public double getVariance()Subclasses must override either getStandardDeviation() or getVariance()!- Specified by:
getVariance
in interfaceDistribution
- See Also:
-
intValue
public final int intValue()- Specified by:
intValue
in interfaceNumberDefinition
-
invoke
- Specified by:
invoke
in interfaceNullaryFunction<Double>
- Specified by:
invoke
in interfacePrimitiveFunction.Nullary
-
longValue
public final long longValue()- Specified by:
longValue
in interfaceNumberDefinition
-
newSampleSet
-
setRandom
Lets you choose between differentRandom
implementations: -
setSeed
public void setSeed(long seed) -
toString
-
checkProbabilty
protected void checkProbabilty(double probabilty) -
generate
protected abstract double generate() -
random
-