Class ImmutableNeatConnectionWeight
java.lang.Object
net.bmahe.genetics4j.neat.spec.mutation.NeatConnectionWeight
net.bmahe.genetics4j.neat.spec.mutation.ImmutableNeatConnectionWeight
- All Implemented Interfaces:
MutationPolicy
@Generated("org.immutables.processor.ProxyProcessor")
public final class ImmutableNeatConnectionWeight
extends NeatConnectionWeight
Immutable implementation of
NeatConnectionWeight
.
Use the builder to create immutable instances:
new NeatConnectionWeight.Builder()
.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Builds instances of typeImmutableNeatConnectionWeight
.private final class
-
Field Summary
Modifier and TypeFieldDescriptionprivate final Distribution
private final Distribution
private final double
private final double
private static final byte
private static final byte
private static final byte
-
Constructor Summary
ModifierConstructorDescriptionprivate
ImmutableNeatConnectionWeight
(double populationMutationProbability, double perturbationRatio, Distribution perturbationDistribution, Distribution newValuesDistribution) private
-
Method Summary
Modifier and TypeMethodDescriptioncopyOf
(NeatConnectionWeight instance) Creates an immutable copy of aNeatConnectionWeight
value.boolean
This instance is equal to all instances ofImmutableNeatConnectionWeight
that have equal attribute values.private boolean
equalTo
(int synthetic, ImmutableNeatConnectionWeight another) int
hashCode()
Computes a hash code from attributes:populationMutationProbability
,perturbationRatio
,perturbationDistribution
,newValuesDistribution
.double
double
toString()
Prints the immutable valueNeatConnectionWeight
with attribute values.private static ImmutableNeatConnectionWeight
validate
(ImmutableNeatConnectionWeight instance) Copy the current immutable object by setting a value for thenewValuesDistribution
attribute.Copy the current immutable object by setting a value for theperturbationDistribution
attribute.withPerturbationRatio
(double value) Copy the current immutable object by setting a value for theperturbationRatio
attribute.withPopulationMutationProbability
(double value) Copy the current immutable object by setting a value for thepopulationMutationProbability
attribute.Methods inherited from class net.bmahe.genetics4j.neat.spec.mutation.NeatConnectionWeight
build, builder, check
-
Field Details
-
populationMutationProbability
private final double populationMutationProbability -
perturbationRatio
private final double perturbationRatio -
perturbationDistribution
-
newValuesDistribution
-
STAGE_INITIALIZING
private static final byte STAGE_INITIALIZING- See Also:
-
STAGE_UNINITIALIZED
private static final byte STAGE_UNINITIALIZED- See Also:
-
STAGE_INITIALIZED
private static final byte STAGE_INITIALIZED- See Also:
-
initShim
-
-
Constructor Details
-
ImmutableNeatConnectionWeight
-
ImmutableNeatConnectionWeight
private ImmutableNeatConnectionWeight(double populationMutationProbability, double perturbationRatio, Distribution perturbationDistribution, Distribution newValuesDistribution)
-
-
Method Details
-
populationMutationProbability
public double populationMutationProbability()- Overrides:
populationMutationProbability
in classNeatConnectionWeight
- Returns:
- The value of the
populationMutationProbability
attribute
-
perturbationRatio
public double perturbationRatio()- Overrides:
perturbationRatio
in classNeatConnectionWeight
- Returns:
- The value of the
perturbationRatio
attribute
-
perturbationDistribution
- Overrides:
perturbationDistribution
in classNeatConnectionWeight
- Returns:
- The value of the
perturbationDistribution
attribute
-
newValuesDistribution
- Overrides:
newValuesDistribution
in classNeatConnectionWeight
- Returns:
- The value of the
newValuesDistribution
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
-
withPerturbationRatio
Copy the current immutable object by setting a value for theperturbationRatio
attribute. A value strict bits equality used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for perturbationRatio- Returns:
- A modified copy of the
this
object
-
withPerturbationDistribution
Copy the current immutable object by setting a value for theperturbationDistribution
attribute. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for perturbationDistribution- Returns:
- A modified copy of the
this
object
-
withNewValuesDistribution
Copy the current immutable object by setting a value for thenewValuesDistribution
attribute. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for newValuesDistribution- Returns:
- A modified copy of the
this
object
-
equals
This instance is equal to all instances ofImmutableNeatConnectionWeight
that have equal attribute values. -
equalTo
-
hashCode
public int hashCode()Computes a hash code from attributes:populationMutationProbability
,perturbationRatio
,perturbationDistribution
,newValuesDistribution
. -
toString
Prints the immutable valueNeatConnectionWeight
with attribute values. -
validate
-
copyOf
Creates an immutable copy of aNeatConnectionWeight
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 NeatConnectionWeight instance
-