- All Implemented Interfaces:
public abstract class BoxSampler extends Object implements SharedStateObjectSampler<double>Generate points uniformly distributed within a n-dimension box (hyperrectangle).
- See Also:
- Hyperrectangle (Wikipedia)
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description
of(UniformRandomProvider rng, double a, double b)Create a box sampler with bounds
sample()Create a sample.
withUniformRandomProvider(UniformRandomProvider rng)Create a new instance of the sampler with the same underlying state using the given uniform random provider as the source of randomness.
public abstract double sample()Description copied from interface:
ObjectSamplerCreate a sample.
public abstract BoxSampler withUniformRandomProvider(UniformRandomProvider rng)
public static BoxSampler of(UniformRandomProvider rng, double a, double b)Create a box sampler with bounds
b. Sampled points are uniformly distributed within the box defined by the bounds.
Sampling is supported in dimensions of 2 or above. Single dimension sampling can be performed using a
Note: There is no requirement that
a <= b. The samples will be uniformly distributed in the range
bfor each dimension.
rng- Source of randomness.
a- Bound a.
b- Bound b.
- the sampler
IllegalArgumentException- If the bounds do not have the same dimension; the dimension is less than 2; or bounds have non-finite coordinates.