Class FixedBooleanRV

All Implemented Interfaces:
Cloneable, RandomVariableOps<Boolean>

public class FixedBooleanRV extends BooleanRandomVariable
Random variable that always generates the same boolean value. Useful when passing a constant to a method that expects a random variable.
  • Constructor Details

    • FixedBooleanRV

      public FixedBooleanRV(boolean value)
      Constructor.
      Parameters:
      value - the value of this random variable
  • Method Details

    • getValue

      public boolean getValue()
      Get the value of this random variable, which is a constant.
      Returns:
      the value
    • next

      public Boolean 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 interface RandomVariableOps<Boolean>
      Specified by:
      next in class RandomVariable<Boolean>
      Returns:
      the next value
    • toString

      public String toString()
      Overrides:
      toString in class Object