Module org.bzdev.math
Package org.bzdev.math.rv
Class BooleanRandomVariableRV<BRV extends BooleanRandomVariable>
- All Implemented Interfaces:
Cloneable
,RandomVariableOps<BRV>
,RandomVariableRVOps<Boolean,
BRV>
- Direct Known Subclasses:
BinomialBooleanRVRV
,FixedBooleanRVRV
public abstract class BooleanRandomVariableRV<BRV extends BooleanRandomVariable>
extends RandomVariableRV<Boolean,BRV>
Random variable that generates the a sequence of random variables, each
of which generates a sequence of boolean values (of type Boolean). The type
parameter BRV is set to the type of random variable that is to be
generated, which will usually be a subclass of LongRandomVariable.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract BRV
next()
Get the next value for a random variable.parallelStream
(long size) Get a fixed-length parallel stream of random variables.stream
(long size) Get a fixed-length stream of random variables.void
tightenMaximumS
(String s, boolean closed) Tighten the maximum value for a random variable given a string.void
tightenMinimumS
(String s, boolean closed) Tighten the minimum value for a random variable given a string.Methods inherited from class org.bzdev.math.rv.RandomVariableRV
determineIfOrdered, getCharacteristics, parallelStream, stream
Methods inherited from class org.bzdev.math.rv.RandomVariable
clone, getMaximum, getMaximumClosed, getMinimum, getMinimumClosed, 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, getMaximumClosed, getMinimum, getMinimumClosed, setMaximum, setMinimum, tightenMaximum, tightenMinimum
-
Constructor Details
-
BooleanRandomVariableRV
public BooleanRandomVariableRV()
-
-
Method Details
-
next
Description copied from class:RandomVariable
Get the next value for a random variable. In general, each value will be independent of the last.- Specified by:
next
in interfaceRandomVariableOps<BRV extends BooleanRandomVariable>
- Specified by:
next
in classRandomVariable<BRV extends BooleanRandomVariable>
- Returns:
- the next value
-
tightenMinimumS
Description copied from class:RandomVariable
Tighten 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:
tightenMinimumS
in interfaceRandomVariableOps<BRV extends BooleanRandomVariable>
- Specified by:
tightenMinimumS
in classRandomVariable<BRV extends BooleanRandomVariable>
- 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:RandomVariable
Tighten 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:
tightenMaximumS
in interfaceRandomVariableOps<BRV extends BooleanRandomVariable>
- Specified by:
tightenMaximumS
in classRandomVariable<BRV extends BooleanRandomVariable>
- 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
Description copied from class:RandomVariableRV
Get a fixed-length stream of random variables.- Overrides:
stream
in classRandomVariableRV<Boolean,
BRV extends BooleanRandomVariable> - Parameters:
size
- the number of random values to provide- Returns:
- the stream
-
parallelStream
Description copied from class:RandomVariableRV
Get a fixed-length parallel stream of random variables.- Overrides:
parallelStream
in classRandomVariableRV<Boolean,
BRV extends BooleanRandomVariable> - Parameters:
size
- the number of random values to provide- Returns:
- the stream
-