- java.lang.Object
-
- org.ojalgo.random.RandomNumber
-
- All Implemented Interfaces:
java.lang.Comparable<RandomNumber>,java.util.function.DoubleSupplier,java.util.function.Supplier<java.lang.Double>,BasicFunction,NullaryFunction<java.lang.Double>,PrimitiveFunction.Nullary,Distribution,AccessScalar<java.lang.Double>,ComparableNumber<RandomNumber>,NumberDefinition
- Direct Known Subclasses:
AbstractContinuous,AbstractDiscrete,Deterministic,Erlang,Gamma,Weibull
public abstract class RandomNumber extends java.lang.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 java.lang.Comparable<N>,F extends BasicFunction>, BasicFunction.Integratable<N extends java.lang.Comparable<N>,F extends BasicFunction>, BasicFunction.PlainUnary<T,R>
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.RandommyRandom
-
Constructor Summary
Constructors Modifier Constructor Description protectedRandomNumber()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidcheckProbabilty(double probabilty)intcompareTo(RandomNumber o)doubledoubleValue()floatfloatValue()protected abstract doublegenerate()doublegetStandardDeviation()Subclasses must override either getStandardDeviation() or getVariance()!doublegetVariance()Subclasses must override either getStandardDeviation() or getVariance()!intintValue()java.lang.Doubleinvoke()longlongValue()SampleSetnewSampleSet(int numberOfSamples)protected java.util.Randomrandom()voidsetRandom(java.util.Random random)Lets you choose between differentRandomimplementations:RandomThreadLocalRandomSecureRandom...voidsetSeed(long seed)java.lang.StringtoString()-
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
-
-
-
-
Method Detail
-
compareTo
public int compareTo(RandomNumber o)
- Specified by:
compareToin interfacejava.lang.Comparable<RandomNumber>
-
doubleValue
public final double doubleValue()
- Specified by:
doubleValuein interfaceNullaryFunction<java.lang.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:
Distribution.getStandardDeviation(),Distribution.getVariance()
-
getVariance
public double getVariance()
Subclasses must override either getStandardDeviation() or getVariance()!- Specified by:
getVariancein interfaceDistribution- See Also:
Distribution.getStandardDeviation(),Distribution.getVariance()
-
intValue
public final int intValue()
- Specified by:
intValuein interfaceNumberDefinition
-
invoke
public final java.lang.Double invoke()
- Specified by:
invokein interfaceNullaryFunction<java.lang.Double>- Specified by:
invokein interfacePrimitiveFunction.Nullary
-
longValue
public final long longValue()
- Specified by:
longValuein interfaceNumberDefinition
-
newSampleSet
public SampleSet newSampleSet(int numberOfSamples)
-
setRandom
public void setRandom(java.util.Random random)
Lets you choose between differentRandomimplementations:RandomThreadLocalRandomSecureRandom- ...
-
setSeed
public void setSeed(long seed)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
checkProbabilty
protected void checkProbabilty(double probabilty)
-
generate
protected abstract double generate()
-
random
protected final java.util.Random random()
-
-