java.lang.Object
io.jenetics.stat.Samplers
This class defines some default samplers.
- Since:
- 8.0
- Version:
- 8.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic Sampler
linear
(double mean) Return a new sampler for a linear distribution with the givenmean
value, when creating sample points for the range[0, 1)
.static Sampler
triangular
(double c) Return a new sampler for a normalized triangle distribution with the points[0, c, 1]
.static Sampler
triangular
(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 givenmean
value, when creating sample points for the range[0, 1)
.- Parameters:
mean
- the mean value of the samplers distribution- Returns:
- a new linear sampler with the given
mean
value - Throws:
IllegalArgumentException
- if the givenmean
value 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 range[0, 1]
.- Parameters:
a
- the start point of the trianglec
- the middle point of the triangleb
- the 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:
-