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 FixedIntegerRV
doNext()
Get the next value for a random variable.void
setMaximum
(Integer max, boolean closed) Set the maximum value for a random variable.void
setMinimum
(Integer min, boolean closed) Set the minimum value for a random variable.void
tightenMaximum
(Integer max, boolean closed) Set the maximum value for a random variable, provided the new value is lower than the previous value.void
tightenMinimum
(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, tightenMinimumS
Methods inherited from class org.bzdev.math.rv.RandomVariableRVN
getMaximumClosed, getMaximumRV, getMinimumClosed, getMinimumRV
Methods inherited from class org.bzdev.math.rv.RandomVariableRV
determineIfOrdered, getCharacteristics, parallelStream, parallelStream, stream, stream
Methods inherited from class org.bzdev.math.rv.RandomVariable
getMaximum, getMinimum, setMaximum, setMinimum, setRequiredMaximum, setRequiredMinimum, spliterator, spliterator, tightenMaximum, tightenMinimum
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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:RandomVariableRVN
Set the minimum value for a random variable. The minimum value will be set for the random variable returned by a call tonext()
- Specified by:
setMinimum
in interfaceRandomVariableRVNOps<Integer,
FixedIntegerRV> - Overrides:
setMinimum
in 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:RandomVariableRVN
Set the maximum value for a random variable. The maximum value will be set for the random variable returned by a call tonext()
- Specified by:
setMaximum
in interfaceRandomVariableRVNOps<Integer,
FixedIntegerRV> - Overrides:
setMaximum
in 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:RandomVariableRVNOps
Set the manimum value for a random variable, provided the new value is higher than the previous value.- Specified by:
tightenMinimum
in interfaceRandomVariableRVNOps<Integer,
FixedIntegerRV> - Overrides:
tightenMinimum
in 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:RandomVariableRVNOps
Set the maximum value for a random variable, provided the new value is lower than the previous value.- Specified by:
tightenMaximum
in interfaceRandomVariableRVNOps<Integer,
FixedIntegerRV> - Overrides:
tightenMaximum
in 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:RandomVariableRVN
Get the next value for a random variable. In general, each value will be independent of the last.- Specified by:
doNext
in classRandomVariableRVN<Integer,
FixedIntegerRV> - Returns:
- the next random variable
- Throws:
RandomVariableException
- the next random variable could not be generated.
-
clone
- Overrides:
clone
in classRandomVariable<FixedIntegerRV>
- Throws:
CloneNotSupportedException
-