java.lang.Object
- All Implemented Interfaces:
Cloneable
,RandomVariableOps<FixedLongRV>
,RandomVariableRVNOps<Long,
,FixedLongRV> RandomVariableRVOps<Long,
FixedLongRV>
Random variable that generates a clone of the same long-valued
random variable repeatedly.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()
protected FixedLongRV
doNext()
Get the next value for a random variable.void
setMaximum
(Long max, boolean closed) Set the maximum value for a random variable.void
setMinimum
(Long min, boolean closed) Set the minimum value for a random variable.void
tightenMaximum
(Long max, boolean closed) Set the maximum value for a random variable, provided the new value is lower than the previous value.void
tightenMinimum
(Long 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.LongRandomVariableRV
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
-
FixedLongRVRV
Constructor.- Parameters:
rv
- the random variable used to provide the value for each FixedLongRV generated.- Throws:
RandomVariableException
- the argument could not be cloned
-
-
Method Details
-
setMinimum
public void setMinimum(Long 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<Long,
FixedLongRV> - Overrides:
setMinimum
in classLongRandomVariableRV<FixedLongRV>
- 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(Long 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<Long,
FixedLongRV> - Overrides:
setMaximum
in classLongRandomVariableRV<FixedLongRV>
- 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(Long 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<Long,
FixedLongRV> - Overrides:
tightenMinimum
in classLongRandomVariableRV<FixedLongRV>
- 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(Long 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<Long,
FixedLongRV> - Overrides:
tightenMaximum
in classLongRandomVariableRV<FixedLongRV>
- 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<Long,
FixedLongRV> - Returns:
- the next random variable
- Throws:
RandomVariableException
- the next random variable could not be generated.
-
clone
- Overrides:
clone
in classRandomVariable<FixedLongRV>
- Throws:
CloneNotSupportedException
-