java.lang.Object
- All Implemented Interfaces:
Cloneable,RandomVariableOps<FixedIntegerRV>,RandomVariableRVNOps<Integer,,FixedIntegerRV> RandomVariableRVOps<Integer,FixedIntegerRV>
Random variable that generates a clone of the same integer-valued
random variable repeatedly.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()protected FixedIntegerRVdoNext()Get the next value for a random variable.voidsetMaximum(Integer max, boolean closed) Set the maximum value for a random variable.voidsetMinimum(Integer min, boolean closed) Set the minimum value for a random variable.voidtightenMaximum(Integer max, boolean closed) Set the maximum value for a random variable, provided the new value is lower than the previous value.voidtightenMinimum(Integer min, boolean closed) Set the manimum value for a random variable, provided the new value is higher than the previous value.Methods inherited from class org.bzdev.math.rv.IntegerRandomVariableRV
cmp, next, tightenMaximumS, tightenMinimumSMethods inherited from class org.bzdev.math.rv.RandomVariableRVN
getMaximumClosed, getMaximumRV, getMinimumClosed, getMinimumRVMethods inherited from class org.bzdev.math.rv.RandomVariableRV
determineIfOrdered, getCharacteristics, parallelStream, parallelStream, stream, streamMethods inherited from class org.bzdev.math.rv.RandomVariable
getMaximum, getMinimum, setMaximum, setMinimum, setRequiredMaximum, setRequiredMinimum, spliterator, spliterator, tightenMaximum, tightenMinimumMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.bzdev.math.rv.RandomVariableOps
getMaximum, getMinimum, setMaximum, setMinimum, tightenMaximum, tightenMinimum
-
Constructor Details
-
FixedIntegerRVRV
Constructor.- Parameters:
rv- the random variable used to provide the value for each FixedIntegerRV generated.- Throws:
RandomVariableException- the argument could not be cloned
-
-
Method Details
-
setMinimum
public void setMinimum(Integer min, boolean closed) throws UnsupportedOperationException, IllegalArgumentException Description copied from class:RandomVariableRVNSet the minimum value for a random variable. The minimum value will be set for the random variable returned by a call tonext()- Specified by:
setMinimumin interfaceRandomVariableRVNOps<Integer,FixedIntegerRV> - Overrides:
setMinimumin classIntegerRandomVariableRV<FixedIntegerRV>- Parameters:
min- minimum value.closed- true if the minimum value is part of the range; false if it is a lower bound on the range- Throws:
UnsupportedOperationException- the random variable's type does not have an order imposed on it or the operation is not supported for implementation reasonsIllegalArgumentException- an argument is out of range
-
setMaximum
public void setMaximum(Integer max, boolean closed) throws UnsupportedOperationException, IllegalArgumentException Description copied from class:RandomVariableRVNSet the maximum value for a random variable. The maximum value will be set for the random variable returned by a call tonext()- Specified by:
setMaximumin interfaceRandomVariableRVNOps<Integer,FixedIntegerRV> - Overrides:
setMaximumin classIntegerRandomVariableRV<FixedIntegerRV>- Parameters:
max- maximum value.closed- true if the minimum value is part of the range; false if it is a lower bound on the range- Throws:
UnsupportedOperationException- the random variable's type does not have an order imposed on it or the operation is not supported for implementation reasonsIllegalArgumentException- an argument is out of range
-
tightenMinimum
public void tightenMinimum(Integer min, boolean closed) throws UnsupportedOperationException, IllegalArgumentException Description copied from interface:RandomVariableRVNOpsSet the manimum value for a random variable, provided the new value is higher than the previous value.- Specified by:
tightenMinimumin interfaceRandomVariableRVNOps<Integer,FixedIntegerRV> - Overrides:
tightenMinimumin classIntegerRandomVariableRV<FixedIntegerRV>- Parameters:
min- minimum value.closed- true if the minimum value is part of the range; false if it is a lower bound on the range- Throws:
UnsupportedOperationException- the random variable's type does not have an order imposed on it or the operation is not supported for implementation reasonsIllegalArgumentException- an argument is out of range
-
tightenMaximum
public void tightenMaximum(Integer max, boolean closed) throws UnsupportedOperationException, IllegalArgumentException Description copied from interface:RandomVariableRVNOpsSet the maximum value for a random variable, provided the new value is lower than the previous value.- Specified by:
tightenMaximumin interfaceRandomVariableRVNOps<Integer,FixedIntegerRV> - Overrides:
tightenMaximumin classIntegerRandomVariableRV<FixedIntegerRV>- Parameters:
max- maximum value.closed- true if the minimum value is part of the range; false if it is a lower bound on the range- Throws:
UnsupportedOperationException- the random variable's type does not have an order imposed on it or the operation is not supported for implementation reasonsIllegalArgumentException- an argument is out of range
-
doNext
Description copied from class:RandomVariableRVNGet the next value for a random variable. In general, each value will be independent of the last.- Specified by:
doNextin classRandomVariableRVN<Integer,FixedIntegerRV> - Returns:
- the next random variable
- Throws:
RandomVariableException- the next random variable could not be generated.
-
clone
- Overrides:
clonein classRandomVariable<FixedIntegerRV>- Throws:
CloneNotSupportedException
-