Class ImmutableCreepMutation
java.lang.Object
net.bmahe.genetics4j.core.spec.mutation.CreepMutation
net.bmahe.genetics4j.core.spec.mutation.ImmutableCreepMutation
- All Implemented Interfaces:
MutationPolicy
@Generated(from="CreepMutation",
generator="Immutables")
@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
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateImmutableCreepMutation(double populationMutationProbability, Distribution distribution) privateImmutableCreepMutation(ImmutableCreepMutation original, double populationMutationProbability, Distribution distribution) -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Creates a builder forCreepMutation.static CreepMutationcopyOf(CreepMutation instance) Creates an immutable copy of aCreepMutationvalue.booleanThis instance is equal to all instances ofImmutableCreepMutationthat have equal attribute values.private booleanequalsByValue(ImmutableCreepMutation another) inthashCode()Computes a hash code from attributes:populationMutationProbability,distribution.static CreepMutationof(double populationMutationProbability, Distribution distribution) Construct a new immutableCreepMutationinstance.doubletoString()Prints the immutable valueCreepMutationwith attribute values.private static ImmutableCreepMutationvalidate(ImmutableCreepMutation instance) final ImmutableCreepMutationwithDistribution(Distribution value) Copy the current immutable object by setting a value for thedistributionattribute.final ImmutableCreepMutationwithPopulationMutationProbability(double value) Copy the current immutable object by setting a value for thepopulationMutationProbabilityattribute.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:
populationMutationProbabilityin classCreepMutation- Returns:
- The value of the
populationMutationProbabilityattribute
-
distribution
- Specified by:
distributionin classCreepMutation- Returns:
- The value of the
distributionattribute
-
withPopulationMutationProbability
Copy the current immutable object by setting a value for thepopulationMutationProbabilityattribute. 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 or the
thisobject
-
withDistribution
Copy the current immutable object by setting a value for thedistributionattribute. 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 or the
thisobject
-
equals
This instance is equal to all instances ofImmutableCreepMutationthat have equal attribute values. -
equalsByValue
-
hashCode
public int hashCode()Computes a hash code from attributes:populationMutationProbability,distribution. -
toString
Prints the immutable valueCreepMutationwith attribute values. -
of
Construct a new immutableCreepMutationinstance.- Parameters:
populationMutationProbability- The value for thepopulationMutationProbabilityattributedistribution- The value for thedistributionattribute- Returns:
- An immutable CreepMutation instance
-
validate
-
copyOf
Creates an immutable copy of aCreepMutationvalue. 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 forCreepMutation.ImmutableCreepMutation.builder() .populationMutationProbability(double) // requiredpopulationMutationProbability.distribution(net.bmahe.genetics4j.core.spec.statistics.distributions.Distribution) // requireddistribution.build();- Returns:
- A new CreepMutation builder
-