Package io.jenetics

Record Class GaussianMutator.Shape

java.lang.Object
java.lang.Record
io.jenetics.GaussianMutator.Shape
Record Components:
shift - the shift parameter, S, determining the mean value of the created mutation value distribution
sigma - the sigma parameter, Σ, determining the standard deviation of the created mutation value distribution
All Implemented Interfaces:
Sampler
Enclosing class:
GaussianMutator<G extends NumericGene<?,G>,C extends Comparable<? super C>>

public static record GaussianMutator.Shape(double shift, double sigma) extends Record implements Sampler
The parameters which define the shape of gaussian distribution of new gene values.

shift
The shift value shifts the mean value of the distribution. Positive values shifts it right and negative values left. Its value must be within the range of [-1, 1]. This restriction ensures the numerical stability of the mutator. The actual µ value is calculated as follows: µ = (shift + 1)*((max - min)/2).
Shift graph
sigma
The sigma value stretches and compresses the distribution and must be within the range of [0.1, 5]. This restriction ensures the numerical stability of the mutator. The actual σ value is calculated as follows: σ = ((max - min)/2)/sigma.
Sigma graph

Since:
8.3
Version:
8.3
  • Field Summary

    Fields inherited from interface io.jenetics.stat.Sampler

    UNIFORM
  • Constructor Summary

    Constructors
    Constructor
    Description
    Shape(double shift, double sigma)
    Create a new mutation distribution shape.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    double
    Create a new double sample point within the given range [min, max).
    double
    Returns the value of the shift record component.
    double
    Returns the value of the sigma record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface io.jenetics.stat.Sampler

    sample
  • Constructor Details

    • Shape

      public Shape(double shift, double sigma)
      Create a new mutation distribution shape.
      Parameters:
      shift - the shift parameter, S, determining the mean value of the crated mutation value distribution
      sigma - the sigma parameter, Σ, determining the standard deviation of the created mutation value distribution
      Throws:
      IllegalArgumentException - if shift < -1 || shift > 1 of sigma < 0.1 || sigma > 5
  • Method Details

    • sample

      public double sample(RandomGenerator random, DoubleRange range)
      Description copied from interface: Sampler
      Create a new double sample point within the given range [min, max).
      Specified by:
      sample in interface Sampler
      Parameters:
      random - the random generator used for creating a sample point of the defined distribution
      range - the range of the sample point: [min, max)
      Returns:
      a new sample point between [min, max)
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • shift

      public double shift()
      Returns the value of the shift record component.
      Returns:
      the value of the shift record component
    • sigma

      public double sigma()
      Returns the value of the sigma record component.
      Returns:
      the value of the sigma record component