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

  • Field Details

    • populationMutationProbability

      private final double populationMutationProbability
    • distribution

      private final Distribution distribution
  • Constructor Details

    • ImmutableCreepMutation

      private ImmutableCreepMutation(double populationMutationProbability, Distribution distribution)
    • ImmutableCreepMutation

      private ImmutableCreepMutation(ImmutableCreepMutation original, double populationMutationProbability, Distribution distribution)
  • Method Details

    • populationMutationProbability

      public double populationMutationProbability()
      Specified by:
      populationMutationProbability in class CreepMutation
      Returns:
      The value of the populationMutationProbability attribute
    • distribution

      public Distribution distribution()
      Specified by:
      distribution in class CreepMutation
      Returns:
      The value of the distribution attribute
    • withPopulationMutationProbability

      public final ImmutableCreepMutation 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
    • withDistribution

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

      public boolean equals(Object another)
      This instance is equal to all instances of ImmutableCreepMutation 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, ImmutableCreepMutation another)
    • hashCode

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

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

      public static ImmutableCreepMutation of(double populationMutationProbability, Distribution distribution)
      Construct a new immutable CreepMutation instance.
      Parameters:
      populationMutationProbability - The value for the populationMutationProbability attribute
      distribution - The value for the distribution attribute
      Returns:
      An immutable CreepMutation instance
    • validate

      private static ImmutableCreepMutation validate(ImmutableCreepMutation instance)
    • copyOf

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

      public static ImmutableCreepMutation.Builder builder()
      Creates a builder for ImmutableCreepMutation.
       ImmutableCreepMutation.builder()
          .populationMutationProbability(double) // required populationMutationProbability
          .distribution(net.bmahe.genetics4j.core.spec.statistics.distributions.Distribution) // required distribution
          .build();
       
      Returns:
      A new ImmutableCreepMutation builder