Class NormalDoubleGenerator.Builder

java.lang.Object
io.bloviate.gen.AbstractBuilder<Double>
io.bloviate.gen.NormalDoubleGenerator.Builder
All Implemented Interfaces:
Builder<Double>
Enclosing class:
NormalDoubleGenerator

public static class NormalDoubleGenerator.Builder extends AbstractBuilder<Double>
Builds a NormalDoubleGenerator, defaulting to a standard normal distribution (mean 0, standard deviation 1) with effectively unbounded min/max.
Since:
2.11.0
  • Constructor Details

    • Builder

      public Builder(RandomGenerator random)
      Creates a builder drawing from the given random source.
      Parameters:
      random - the random source backing the generated values
  • Method Details

    • mean

      public NormalDoubleGenerator.Builder mean(double mean)
      Sets the distribution mean (center). Returns this builder for chaining.
      Parameters:
      mean - the mean of the normal distribution
      Returns:
      this builder
    • standardDeviation

      public NormalDoubleGenerator.Builder standardDeviation(double standardDeviation)
      Sets the distribution standard deviation (spread); must be non-negative. Returns this builder for chaining.
      Parameters:
      standardDeviation - the standard deviation of the normal distribution
      Returns:
      this builder
    • min

      public NormalDoubleGenerator.Builder min(double min)
      Sets the inclusive lower bound that generated values are clamped to. Returns this builder for chaining.
      Parameters:
      min - the minimum value
      Returns:
      this builder
    • max

      public NormalDoubleGenerator.Builder max(double max)
      Sets the inclusive upper bound that generated values are clamped to. Returns this builder for chaining.
      Parameters:
      max - the maximum value
      Returns:
      this builder
    • build

      public NormalDoubleGenerator build()
      Description copied from interface: Builder
      Builds and returns a configured data generator.
      Returns:
      a new DataGenerator configured with the builder's settings