Interface RVariableIfc

    • Method Detail

      • getValue

        default double getValue()
        Description copied from interface: GetValueIfc
        This method simply returns the value.
        Specified by:
        getValue in interface GetValueIfc
        Returns:
        returns a sampled values
      • getSumOfValues

        default double getSumOfValues​(int n)
        Parameters:
        n - the number of values to sum, must be 1 or more
        Returns:
        the sum of n values of getValue()
      • newInstance

        RVariableIfc newInstance​(RNStreamIfc rng)
        Parameters:
        rng - the RNStreamIfc to use
        Returns:
        a new instance with same parameter values
      • newInstance

        default RVariableIfc newInstance()
        Returns:
        a new instance with same parameter values, with a different stream
      • getAsDouble

        default double getAsDouble()
        This method facilitates turning instances of RVariableIfc into Java DoubleStream for use in the Stream API
        Specified by:
        getAsDouble in interface java.util.function.DoubleSupplier
        Returns:
        the generated random number using sample()
      • asDoubleStream

        default java.util.stream.DoubleStream asDoubleStream()
        Turns the doubles into a DoubleStream for the Stream API
        Returns:
        a DoubleStream representation of the random variable