- All Implemented Interfaces:
Cloneable,RandomVariableOps<Boolean>
- Direct Known Subclasses:
BinomialBooleanRV,DetermBooleanRV,FixedBooleanRV,UniformBooleanRV
Base class for Boolean-valued random numbers.
The setMinimum, setMaximum, setRequiredMinimum, setRequiredMaximum,
tightenMinimum, tightenMaximum,, tightenMinimumS, and
tightenMaximumS methods from the RandomVariable interface throw an
UnsupportedOperationException as boolean values are not ordered.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet an infinite parallel stream of boolean values.parallelStream(long size) Get a fixed-length parallel stream of boolean values.stream()Get an infinite stream of boolean values.stream(long size) Get a fixed-length stream of boolean values.voidtightenMaximumS(String s, boolean closed) Tighten the maximum value for a random variable given a string.voidtightenMinimumS(String s, boolean closed) Tighten the minimum value for a random variable given a string.Methods inherited from class org.bzdev.math.rv.RandomVariable
clone, getCharacteristics, getMaximum, getMaximumClosed, getMinimum, getMinimumClosed, next, setMaximum, setMinimum, setRequiredMaximum, setRequiredMinimum, spliterator, spliterator, tightenMaximum, tightenMinimum
-
Constructor Details
-
BooleanRandomVariable
public BooleanRandomVariable()
-
-
Method Details
-
tightenMinimumS
Description copied from class:RandomVariableTighten the minimum value for a random variable given a string. If there is no minimum value, it will be set. Otherwise the minimum of the allowed range will not decrease. The string argument is a number in a format acceptable to the constructors for Integer, Long, or Double as appropriate.- Specified by:
tightenMinimumSin interfaceRandomVariableOps<Boolean>- Specified by:
tightenMinimumSin classRandomVariable<Boolean>- Parameters:
s- 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 reasons
-
tightenMaximumS
Description copied from class:RandomVariableTighten the maximum value for a random variable given a string. If there is no maximum value, it will be set. Otherwise the maximum of the allowed range will not increase. The string argument is a number in a format acceptable to the constructors for Integer, Long, or Double as appropriate.- Specified by:
tightenMaximumSin interfaceRandomVariableOps<Boolean>- Specified by:
tightenMaximumSin classRandomVariable<Boolean>- Parameters:
s- 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 reasons
-
stream
Get a fixed-length stream of boolean values.- Parameters:
size- the number of random values to provide- Returns:
- the stream
-
parallelStream
Get a fixed-length parallel stream of boolean values.- Parameters:
size- the number of random values to provide- Returns:
- the stream
-
stream
Get an infinite stream of boolean values.- Returns:
- the stream
-
parallelStream
Get an infinite parallel stream of boolean values.- Returns:
- the stream
-