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 BasicFunction
BasicFunction.Differentiable<N,F>, BasicFunction.Integratable<N, F>, BasicFunction.PlainUnary<T, R> -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcheckProbabilty(double probabilty) intfinal doublefinal floatprotected abstract doublegenerate()doubleSubclasses must override either getStandardDeviation() or getVariance()!doubleSubclasses must override either getStandardDeviation() or getVariance()!final intintValue()final Doubleinvoke()final longnewSampleSet(int numberOfSamples) protected final Randomrandom()voidvoidsetSeed(long seed) toString()Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface Distribution
getExpectedMethods inherited from interface NullaryFunction
andThen, get, getAsDoubleMethods inherited from interface NumberDefinition
booleanValue, byteValue, shortValue
-
Field Details
-
myRandom
-
-
Constructor Details
-
RandomNumber
protected RandomNumber()
-
-
Method Details
-
compareTo
- Specified by:
compareToin interfaceComparable<RandomNumber>
-
doubleValue
public final double doubleValue()- Specified by:
doubleValuein interfaceNullaryFunction<Double>- Specified by:
doubleValuein interfaceNumberDefinition
-
floatValue
public final float floatValue()- Specified by:
floatValuein interfaceNumberDefinition
-
getStandardDeviation
public double getStandardDeviation()Subclasses must override either getStandardDeviation() or getVariance()!- Specified by:
getStandardDeviationin interfaceDistribution- See Also:
-
getVariance
public double getVariance()Subclasses must override either getStandardDeviation() or getVariance()!- Specified by:
getVariancein interfaceDistribution- See Also:
-
intValue
public final int intValue()- Specified by:
intValuein interfaceNumberDefinition
-
invoke
- Specified by:
invokein interfaceNullaryFunction<Double>- Specified by:
invokein interfacePrimitiveFunction.Nullary
-
longValue
public final long longValue()- Specified by:
longValuein interfaceNumberDefinition
-
newSampleSet
-
setRandom
Lets you choose between differentRandomimplementations: -
setSeed
public void setSeed(long seed) -
toString
-
checkProbabilty
protected void checkProbabilty(double probabilty) -
generate
protected abstract double generate() -
random
-