Class NormalDoubleGenerator.Builder
- Enclosing class:
NormalDoubleGenerator
Builds a
NormalDoubleGenerator, defaulting to a standard normal distribution (mean 0, standard deviation 1) with effectively unbounded min/max.- Since:
- 2.11.0
-
Field Summary
Fields inherited from class AbstractBuilder
DEFAULT_REFERENCE, random -
Constructor Summary
ConstructorsConstructorDescriptionBuilder(RandomGenerator random) Creates a builder drawing from the given random source. -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds and returns a configured data generator.max(double max) Sets the inclusive upper bound that generated values are clamped to.mean(double mean) Sets the distribution mean (center).min(double min) Sets the inclusive lower bound that generated values are clamped to.standardDeviation(double standardDeviation) Sets the distribution standard deviation (spread); must be non-negative.
-
Constructor Details
-
Builder
Creates a builder drawing from the given random source.- Parameters:
random- the random source backing the generated values
-
-
Method Details
-
mean
Sets the distribution mean (center). Returns this builder for chaining.- Parameters:
mean- the mean of the normal distribution- Returns:
- this builder
-
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
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
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
Description copied from interface:BuilderBuilds and returns a configured data generator.- Returns:
- a new
DataGeneratorconfigured with the builder's settings
-