Class ImmutableCreepMutation
java.lang.Object
net.bmahe.genetics4j.core.spec.mutation.CreepMutation
net.bmahe.genetics4j.core.spec.mutation.ImmutableCreepMutation
- All Implemented Interfaces:
MutationPolicy
@Generated("org.immutables.processor.ProxyProcessor")
public final class ImmutableCreepMutation
extends CreepMutation
Immutable implementation of
CreepMutation
.
Use the builder to create immutable instances:
ImmutableCreepMutation.builder()
.
Use the static factory method to create immutable instances:
ImmutableCreepMutation.of()
.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
Builds instances of typeImmutableCreepMutation
. -
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprivate
ImmutableCreepMutation
(double populationMutationProbability, Distribution distribution) private
ImmutableCreepMutation
(ImmutableCreepMutation original, double populationMutationProbability, Distribution distribution) -
Method Summary
Modifier and TypeMethodDescriptionbuilder()
Creates a builder forImmutableCreepMutation
.static ImmutableCreepMutation
copyOf
(CreepMutation instance) Creates an immutable copy of aCreepMutation
value.boolean
This instance is equal to all instances ofImmutableCreepMutation
that have equal attribute values.private boolean
equalTo
(int synthetic, ImmutableCreepMutation another) int
hashCode()
Computes a hash code from attributes:populationMutationProbability
,distribution
.static ImmutableCreepMutation
of
(double populationMutationProbability, Distribution distribution) Construct a new immutableCreepMutation
instance.double
toString()
Prints the immutable valueCreepMutation
with attribute values.private static ImmutableCreepMutation
validate
(ImmutableCreepMutation instance) final ImmutableCreepMutation
withDistribution
(Distribution value) Copy the current immutable object by setting a value for thedistribution
attribute.final ImmutableCreepMutation
withPopulationMutationProbability
(double value) Copy the current immutable object by setting a value for thepopulationMutationProbability
attribute.Methods inherited from class net.bmahe.genetics4j.core.spec.mutation.CreepMutation
check, ofNormal
-
Field Details
-
populationMutationProbability
private final double populationMutationProbability -
distribution
-
-
Constructor Details
-
ImmutableCreepMutation
-
ImmutableCreepMutation
private ImmutableCreepMutation(ImmutableCreepMutation original, double populationMutationProbability, Distribution distribution)
-
-
Method Details
-
populationMutationProbability
public double populationMutationProbability()- Specified by:
populationMutationProbability
in classCreepMutation
- Returns:
- The value of the
populationMutationProbability
attribute
-
distribution
- Specified by:
distribution
in classCreepMutation
- Returns:
- The value of the
distribution
attribute
-
withPopulationMutationProbability
Copy the current immutable object by setting a value for thepopulationMutationProbability
attribute. A value strict bits equality used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for populationMutationProbability- Returns:
- A modified copy of the
this
object
-
withDistribution
Copy the current immutable object by setting a value for thedistribution
attribute. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for distribution- Returns:
- A modified copy of the
this
object
-
equals
This instance is equal to all instances ofImmutableCreepMutation
that have equal attribute values. -
equalTo
-
hashCode
public int hashCode()Computes a hash code from attributes:populationMutationProbability
,distribution
. -
toString
Prints the immutable valueCreepMutation
with attribute values. -
of
public static ImmutableCreepMutation of(double populationMutationProbability, Distribution distribution) Construct a new immutableCreepMutation
instance.- Parameters:
populationMutationProbability
- The value for thepopulationMutationProbability
attributedistribution
- The value for thedistribution
attribute- Returns:
- An immutable CreepMutation instance
-
validate
-
copyOf
Creates an immutable copy of aCreepMutation
value. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Parameters:
instance
- The instance to copy- Returns:
- A copied immutable CreepMutation instance
-
builder
Creates a builder forImmutableCreepMutation
.ImmutableCreepMutation.builder() .populationMutationProbability(double) // required
populationMutationProbability
.distribution(net.bmahe.genetics4j.core.spec.statistics.distributions.Distribution) // requireddistribution
.build();- Returns:
- A new ImmutableCreepMutation builder
-