Interface ContinuousDistribution.Sampler

  • Enclosing interface:
    ContinuousDistribution
    Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

    @FunctionalInterface
    public static interface ContinuousDistribution.Sampler
    Distribution sampling functionality.
    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      double sample()
      Generates a random value sampled from this distribution.
      default java.util.stream.DoubleStream samples()
      Returns an effectively unlimited stream of double sample values.
      default java.util.stream.DoubleStream samples​(long streamSize)
      Returns a stream producing the given streamSize number of double sample values.
    • Method Detail

      • sample

        double sample()
        Generates a random value sampled from this distribution.
        Returns:
        a random value.
      • samples

        default java.util.stream.DoubleStream samples()
        Returns an effectively unlimited stream of double sample values.

        The default implementation produces a sequential stream that repeatedly calls sample().

        Returns:
        a stream of double values.
      • samples

        default java.util.stream.DoubleStream samples​(long streamSize)
        Returns a stream producing the given streamSize number of double sample values.

        The default implementation produces a sequential stream that repeatedly calls sample(); the stream is limited to the given streamSize.

        Parameters:
        streamSize - Number of values to generate.
        Returns:
        a stream of double values.