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().

  • Field Details

    • populationMutationProbability

      private final double populationMutationProbability
    • perturbationRatio

      private final double perturbationRatio
    • perturbationDistribution

      private final Distribution perturbationDistribution
    • newValuesDistribution

      private final Distribution 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

      private transient volatile ImmutableNeatConnectionWeight.InitShim initShim
  • Constructor Details

    • ImmutableNeatConnectionWeight

      private ImmutableNeatConnectionWeight(ImmutableNeatConnectionWeight.Builder builder)
    • ImmutableNeatConnectionWeight

      private ImmutableNeatConnectionWeight(double populationMutationProbability, double perturbationRatio, Distribution perturbationDistribution, Distribution newValuesDistribution)
  • Method Details

    • populationMutationProbability

      public double populationMutationProbability()
      Overrides:
      populationMutationProbability in class NeatConnectionWeight
      Returns:
      The value of the populationMutationProbability attribute
    • perturbationRatio

      public double perturbationRatio()
      Overrides:
      perturbationRatio in class NeatConnectionWeight
      Returns:
      The value of the perturbationRatio attribute
    • perturbationDistribution

      public Distribution perturbationDistribution()
      Overrides:
      perturbationDistribution in class NeatConnectionWeight
      Returns:
      The value of the perturbationDistribution attribute
    • newValuesDistribution

      public Distribution newValuesDistribution()
      Overrides:
      newValuesDistribution in class NeatConnectionWeight
      Returns:
      The value of the newValuesDistribution attribute
    • withPopulationMutationProbability

      public final ImmutableNeatConnectionWeight withPopulationMutationProbability(double value)
      Copy the current immutable object by setting a value for the populationMutationProbability attribute. A value strict bits equality used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for populationMutationProbability
      Returns:
      A modified copy of the this object
    • withPerturbationRatio

      public final ImmutableNeatConnectionWeight withPerturbationRatio(double value)
      Copy the current immutable object by setting a value for the perturbationRatio attribute. A value strict bits equality used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for perturbationRatio
      Returns:
      A modified copy of the this object
    • withPerturbationDistribution

      public final ImmutableNeatConnectionWeight withPerturbationDistribution(Distribution value)
      Copy the current immutable object by setting a value for the perturbationDistribution attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for perturbationDistribution
      Returns:
      A modified copy of the this object
    • withNewValuesDistribution

      public final ImmutableNeatConnectionWeight withNewValuesDistribution(Distribution value)
      Copy the current immutable object by setting a value for the newValuesDistribution attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for newValuesDistribution
      Returns:
      A modified copy of the this object
    • equals

      public boolean equals(Object another)
      This instance is equal to all instances of ImmutableNeatConnectionWeight that have equal attribute values.
      Overrides:
      equals in class Object
      Returns:
      true if this is equal to another instance
    • equalTo

      private boolean equalTo(int synthetic, ImmutableNeatConnectionWeight another)
    • hashCode

      public int hashCode()
      Computes a hash code from attributes: populationMutationProbability, perturbationRatio, perturbationDistribution, newValuesDistribution.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

      public String toString()
      Prints the immutable value NeatConnectionWeight with attribute values.
      Overrides:
      toString in class Object
      Returns:
      A string representation of the value
    • validate

    • copyOf

      public static ImmutableNeatConnectionWeight copyOf(NeatConnectionWeight instance)
      Creates an immutable copy of a NeatConnectionWeight 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