java.lang.Object
io.jenetics.stat.Samplers
This class defines some default samplers.
- Since:
- 8.0
- Version:
- 8.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic Samplerlinear(double mean) Return a new sampler for a linear distribution with the givenmeanvalue, when creating sample points for the normalized range[0, 1).static Samplertriangular(double c) Return a new sampler for a normalized triangle distribution with the points[0, c, 1].static Samplertriangular(double a, double c, double b) Create a new sampler for a triangle distribution with the given parameters.
-
Method Details
-
linear
Return a new sampler for a linear distribution with the givenmeanvalue, when creating sample points for the normalized range[0, 1).- Parameters:
mean- the mean value of the sampler distribution- Returns:
- a new linear sampler with the given
meanvalue - Throws:
IllegalArgumentException- if the givenmeanvalue is not within the range[0, 1)
-
triangular
Create a new sampler for a triangle distribution with the given parameters. All parameters must be within the normalized range[0, 1]. The sample value, returned by theSampler.sample(RandomGenerator, DoubleRange)method, is then stretched to the desired range.- Parameters:
a- the normalized start point of the trianglec- the normalized middle point of the triangleb- the normalized end point of the triangle- Returns:
- a new triangle distribution sampler
- Throws:
IllegalArgumentException- if one of the parameters is not within the range[0, 1]orb <= a || c > b || c < a- See Also:
-
triangular
Return a new sampler for a normalized triangle distribution with the points[0, c, 1].- Parameters:
c- the middle point of the triangle within the range[0, 1]- Returns:
- a new triangle distribution sampler
- Throws:
IllegalArgumentException- if c not within[0, 1]- See Also:
-