Package org.ojalgo.random
Class RandomNumber
- 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.Random
myRandom
-
Constructor Summary
Constructors Modifier Constructor Description protected
RandomNumber()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
checkProbabilty(double probabilty)
int
compareTo(RandomNumber o)
double
doubleValue()
float
floatValue()
protected abstract double
generate()
double
getStandardDeviation()
Subclasses must override either getStandardDeviation() or getVariance()!double
getVariance()
Subclasses must override either getStandardDeviation() or getVariance()!int
intValue()
java.lang.Double
invoke()
long
longValue()
SampleSet
newSampleSet(int numberOfSamples)
protected java.util.Random
random()
void
setRandom(java.util.Random random)
Lets you choose between differentRandom
implementations:Random
ThreadLocalRandom
SecureRandom
...void
setSeed(long seed)
java.lang.String
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
-
-
-
-
Method Detail
-
compareTo
public int compareTo(RandomNumber o)
- Specified by:
compareTo
in interfacejava.lang.Comparable<RandomNumber>
-
doubleValue
public final double doubleValue()
- Specified by:
doubleValue
in interfaceNullaryFunction<java.lang.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:
Distribution.getStandardDeviation()
,Distribution.getVariance()
-
getVariance
public double getVariance()
Subclasses must override either getStandardDeviation() or getVariance()!- Specified by:
getVariance
in interfaceDistribution
- See Also:
Distribution.getStandardDeviation()
,Distribution.getVariance()
-
intValue
public final int intValue()
- Specified by:
intValue
in interfaceNumberDefinition
-
invoke
public final java.lang.Double invoke()
- Specified by:
invoke
in interfaceNullaryFunction<java.lang.Double>
- Specified by:
invoke
in interfacePrimitiveFunction.Nullary
-
longValue
public final long longValue()
- Specified by:
longValue
in interfaceNumberDefinition
-
newSampleSet
public SampleSet newSampleSet(int numberOfSamples)
-
setRandom
public void setRandom(java.util.Random random)
Lets you choose between differentRandom
implementations:Random
ThreadLocalRandom
SecureRandom
- ...
-
setSeed
public void setSeed(long seed)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
checkProbabilty
protected void checkProbabilty(double probabilty)
-
generate
protected abstract double generate()
-
random
protected final java.util.Random random()
-
-