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 FixedLongRVdoNext()Get the next value for a random variable.voidsetMaximum(Long max, boolean closed) Set the maximum value for a random variable.voidsetMinimum(Long min, boolean closed) Set the minimum value for a random variable.voidtightenMaximum(Long max, boolean closed) Set the maximum value for a random variable, provided the new value is lower than the previous value.voidtightenMinimum(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, 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
-
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: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<Long,FixedLongRV> - Overrides:
setMinimumin 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: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<Long,FixedLongRV> - Overrides:
setMaximumin 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:RandomVariableRVNOpsSet the manimum value for a random variable, provided the new value is higher than the previous value.- Specified by:
tightenMinimumin interfaceRandomVariableRVNOps<Long,FixedLongRV> - Overrides:
tightenMinimumin 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:RandomVariableRVNOpsSet the maximum value for a random variable, provided the new value is lower than the previous value.- Specified by:
tightenMaximumin interfaceRandomVariableRVNOps<Long,FixedLongRV> - Overrides:
tightenMaximumin 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:RandomVariableRVNGet the next value for a random variable. In general, each value will be independent of the last.- Specified by:
doNextin classRandomVariableRVN<Long,FixedLongRV> - Returns:
- the next random variable
- Throws:
RandomVariableException- the next random variable could not be generated.
-
clone
- Overrides:
clonein classRandomVariable<FixedLongRV>- Throws:
CloneNotSupportedException
-