Class ImmutableNeatConnectionWeight
java.lang.Object
net.bmahe.genetics4j.neat.spec.mutation.NeatConnectionWeight
net.bmahe.genetics4j.neat.spec.mutation.ImmutableNeatConnectionWeight
- All Implemented Interfaces:
MutationPolicy
@Generated(from="NeatConnectionWeight",
generator="Immutables")
@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
Nested ClassesModifier and TypeClassDescriptionstatic classBuilds instances of typeNeatConnectionWeight.private final class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Distributionprivate final Distributionprivate final doubleprivate final doubleprivate static final byteprivate static final byteprivate static final byte -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateImmutableNeatConnectionWeight(double populationMutationProbability, double perturbationRatio, Distribution perturbationDistribution, Distribution newValuesDistribution) private -
Method Summary
Modifier and TypeMethodDescriptionstatic NeatConnectionWeightcopyOf(NeatConnectionWeight instance) Creates an immutable copy of aNeatConnectionWeightvalue.booleanThis instance is equal to all instances ofImmutableNeatConnectionWeightthat have equal attribute values.private booleaninthashCode()Computes a hash code from attributes:populationMutationProbability,perturbationRatio,perturbationDistribution,newValuesDistribution.doubledoubletoString()Prints the immutable valueNeatConnectionWeightwith attribute values.private static ImmutableNeatConnectionWeightvalidate(ImmutableNeatConnectionWeight instance) Copy the current immutable object by setting a value for thenewValuesDistributionattribute.Copy the current immutable object by setting a value for theperturbationDistributionattribute.withPerturbationRatio(double value) Copy the current immutable object by setting a value for theperturbationRatioattribute.withPopulationMutationProbability(double value) Copy the current immutable object by setting a value for thepopulationMutationProbabilityattribute.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:
populationMutationProbabilityin classNeatConnectionWeight- Returns:
- The value of the
populationMutationProbabilityattribute
-
perturbationRatio
public double perturbationRatio()- Overrides:
perturbationRatioin classNeatConnectionWeight- Returns:
- The value of the
perturbationRatioattribute
-
perturbationDistribution
- Overrides:
perturbationDistributionin classNeatConnectionWeight- Returns:
- The value of the
perturbationDistributionattribute
-
newValuesDistribution
- Overrides:
newValuesDistributionin classNeatConnectionWeight- Returns:
- The value of the
newValuesDistributionattribute
-
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
-
withPerturbationRatio
Copy the current immutable object by setting a value for theperturbationRatioattribute. 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 or the
thisobject
-
withPerturbationDistribution
Copy the current immutable object by setting a value for theperturbationDistributionattribute. 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 or the
thisobject
-
withNewValuesDistribution
Copy the current immutable object by setting a value for thenewValuesDistributionattribute. 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 or the
thisobject
-
equals
This instance is equal to all instances ofImmutableNeatConnectionWeightthat have equal attribute values. -
equalsByValue
-
hashCode
public int hashCode()Computes a hash code from attributes:populationMutationProbability,perturbationRatio,perturbationDistribution,newValuesDistribution. -
toString
Prints the immutable valueNeatConnectionWeightwith attribute values. -
validate
-
copyOf
Creates an immutable copy of aNeatConnectionWeightvalue. 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
-