- All Known Subinterfaces:
NamedRandomVariableOps<T,
,RV> RandomVariableRVNOps<T,
,RV> RandomVariableRVOps<T,
RV>
- All Known Implementing Classes:
BinomialBooleanRV
,BinomialBooleanRVRV
,BinomialDoubleRV
,BinomialDoubleRVRV
,BinomialIATimeRV
,BinomialIATimeRVRV
,BinomialIntegerRV
,BinomialIntegerRVRV
,BinomialLongRV
,BinomialLongRVRV
,BooleanRandomVariable
,BooleanRandomVariableRV
,DetermBooleanRV
,DetermDoubleRV
,DetermIATimeRV
,DetermIntegerRV
,DetermLongRV
,DoubleRandomVariable
,DoubleRandomVariableRV
,ExpDistrRV
,ExpDistrRVRV
,FixedBooleanRV
,FixedBooleanRVRV
,FixedDoubleRV
,FixedDoubleRVRV
,FixedIATimeRV
,FixedIATimeRVRV
,FixedIntegerRV
,FixedIntegerRVRV
,FixedLongRV
,FixedLongRVRV
,GaussianIATimeRV
,GaussianIATimeRVRV
,GaussianRV
,GaussianRVRV
,IntegerRandomVariable
,IntegerRandomVariableRV
,InterarrivalTimeRV
,InterarrivalTimeRVRV
,LogNormalRV
,LogNormalRVRV
,LongRandomVariable
,LongRandomVariableRV
,PoissonDoubleRV
,PoissonDoubleRVRV
,PoissonIATimeRV
,PoissonIATimeRVRV
,PoissonIntegerRV
,PoissonIntegerRVRV
,PoissonLongRV
,PoissonLongRVRV
,RandomVariable
,RandomVariableRV
,RandomVariableRVN
,SimBinomialBooleanRV
,SimBinomialBooleanRVRV
,SimBinomialDoubleRV
,SimBinomialDoubleRVRV
,SimBinomialIATimeRV
,SimBinomialIATimeRVRV
,SimBinomialIntegerRV
,SimBinomialIntegerRVRV
,SimBinomialLongRV
,SimBinomialLongRVRV
,SimBooleanRV
,SimBooleanRVRV
,SimDetermBooleanRV
,SimDetermDoubleRV
,SimDetermIATimeRV
,SimDetermIntegerRV
,SimDetermLongRV
,SimDoubleRV
,SimDoubleRVRV
,SimExpDistrRV
,SimExpDistrRVRV
,SimFixedBooleanRV
,SimFixedBooleanRVRV
,SimFixedDoubleRV
,SimFixedDoubleRVRV
,SimFixedIATimeRV
,SimFixedIATimeRVRV
,SimFixedIntegerRV
,SimFixedIntegerRVRV
,SimFixedLongRV
,SimFixedLongRVRV
,SimGaussianIATimeRV
,SimGaussianIATimeRVRV
,SimGaussianRV
,SimGaussianRVRV
,SimIntegerRV
,SimIntegerRVRV
,SimInterarrivalTimeRV
,SimInterarrivalTimeRVRV
,SimLogNormalRV
,SimLogNormalRVRV
,SimLongRV
,SimLongRVRV
,SimPoissonDoubleRV
,SimPoissonDoubleRVRV
,SimPoissonIATimeRV
,SimPoissonIATimeRVRV
,SimPoissonIntegerRV
,SimPoissonIntegerRVRV
,SimPoissonLongRV
,SimPoissonLongRVRV
,SimRandomVariable
,SimRandomVariableRV
,SimRandomVariableRVN
,SimUniformBooleanRV
,SimUniformDoubleRV
,SimUniformDoubleRVRV
,SimUniformIATimeRV
,SimUniformIATimeRVRV
,SimUniformIntegerRV
,SimUniformIntegerRVRV
,SimUniformLongRV
,SimUniformLongRVRV
,UniformBooleanRV
,UniformDoubleRV
,UniformDoubleRVRV
,UniformIATimeRV
,UniformIATimeRVRV
,UniformIntegerRV
,UniformIntegerRVRV
,UniformLongRV
,UniformLongRVRV
public interface RandomVariableOps<T>
Random Variable Interface.
This is interface is the root of a hierarchy of interfaces that
are paired with a class hierarchy whose base class is
RandomVariable
and is provided for cases where it is not
possible to directly create a subclass of RandomVariable
.
The class RandomVariable
itself implements this interface.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionGet the upper bound on the values that can be generated.Determine if a random variable's upper bound can be generated.Get the lower bound on the values that can be generated.Determine if a random variable's lower bound can be generated.next()
Get the next value for a random variable.void
setMaximum
(T max, boolean closed) Set the maximum value for a random variable.void
setMinimum
(T min, boolean closed) Set the minimum value for a random variable.void
tightenMaximum
(T max, boolean closed) Tighten the maximum value for a random variable.void
tightenMaximumS
(String max, boolean closed) Tighten the maximum value for a random variable given a string.void
tightenMinimum
(T min, boolean closed) Tighten the minimum value for a random variable.void
tightenMinimumS
(String min, boolean closed) Tighten the minimum value for a random variable given a string.
-
Method Details
-
setMinimum
void setMinimum(T min, boolean closed) throws UnsupportedOperationException, IllegalArgumentException Set the minimum value for a random variable.- 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
-
tightenMinimum
void tightenMinimum(T min, boolean closed) throws UnsupportedOperationException, IllegalArgumentException Tighten the minimum value for a random variable. If there is no minimum value, it will be set. Otherwise the minimum of the allowed range will not decrease.- 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
-
tightenMinimumS
void tightenMinimumS(String min, boolean closed) throws UnsupportedOperationException, IllegalArgumentException 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.- 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
void setMaximum(T max, boolean closed) throws UnsupportedOperationException, IllegalArgumentException Set the maximum value for a random variable.- 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
-
tightenMaximum
void tightenMaximum(T max, boolean closed) throws UnsupportedOperationException, IllegalArgumentException Tighten the maximum value for a random variable. If there is no maximum value, it will be set. Otherwise the maximum of the allowed range will not increase.- 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
-
tightenMaximumS
void tightenMaximumS(String max, boolean closed) throws UnsupportedOperationException, IllegalArgumentException 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.- 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
-
next
Get the next value for a random variable. In general, each value will be independent of the last.- Returns:
- the next value
- Throws:
RandomVariableException
- if the next value could not be generated
-
getMinimum
T getMinimum()Get the lower bound on the values that can be generated. Some random numbers do not have an ordering, so that null will always be returned in that case.- Returns:
- the lower bound; null if there is none
-
getMinimumClosed
Boolean getMinimumClosed()Determine if a random variable's lower bound can be generated.- Returns:
- true if it can be generated; false if it cannot be generated; null if this cannot be determined
-
getMaximum
T getMaximum()Get the upper bound on the values that can be generated. Some random numbers do not have an ordering, so that null will always be returned in that case.- Returns:
- the upper bound; null if there is none
-
getMaximumClosed
Boolean getMaximumClosed()Determine if a random variable's upper bound can be generated.- Returns:
- true if it can be generated; false if it cannot be generated; null if this cannot be determined
-