Class Samplers

java.lang.Object
io.jenetics.stat.Samplers

public final class Samplers extends Object
This class defines some default samplers.
Since:
8.0
Version:
8.0
  • Method Summary

    Modifier and Type
    Method
    Description
    static Sampler
    linear(double mean)
    Return a new sampler for a linear distribution with the given mean 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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • linear

      public static Sampler linear(double mean)
      Return a new sampler for a linear distribution with the given mean value, when creating sample points for the range [0, 1).

      Linear distribution sampler

      Parameters:
      mean - the mean value of the samplers distribution
      Returns:
      a new linear sampler with the given mean value
      Throws:
      IllegalArgumentException - if the given mean value is not within the range [0, 1)
    • triangular

      public static Sampler triangular(double a, double c, double b)
      Create a new sampler for a triangle distribution with the given parameters. All parameters must be within the range [0, 1].

      Triangle distribution sampler

      Parameters:
      a - the start point of the triangle
      c - the middle point of the triangle
      b - 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] or b <= a || c > b || c < a
      See Also:
    • triangular

      public static Sampler triangular(double c)
      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: