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 distributionsigma
- 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)
.
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
.
- Since:
- 8.3
- Version:
- 8.3
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.double
sample
(RandomGenerator random, DoubleRange range) Create a newdouble
sample point within the given range[min, max)
.double
shift()
Returns the value of theshift
record component.double
sigma()
Returns the value of thesigma
record component.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
Shape
Create a new mutation distribution shape.- Parameters:
shift
- the shift parameter, S, determining the mean value of the crated mutation value distributionsigma
- the sigma parameter, Σ, determining the standard deviation of the created mutation value distribution- Throws:
IllegalArgumentException
- ifshift < -1 || shift > 1
ofsigma < 0.1 || sigma > 5
-
-
Method Details
-
sample
Description copied from interface:Sampler
Create a newdouble
sample point within the given range[min, max)
. -
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. -
hashCode
Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
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 '=='. -
shift
Returns the value of theshift
record component.- Returns:
- the value of the
shift
record component
-
sigma
Returns the value of thesigma
record component.- Returns:
- the value of the
sigma
record component
-