Class ImmutableProgramRandomMutate

java.lang.Object
net.bmahe.genetics4j.gp.spec.mutation.ImmutableProgramRandomMutate
All Implemented Interfaces:
MutationPolicy, ProgramRandomMutate

@Generated("org.immutables.processor.ProxyProcessor") public final class ImmutableProgramRandomMutate extends Object implements ProgramRandomMutate
Immutable implementation of ProgramRandomMutate.

Use the builder to create immutable instances: ImmutableProgramRandomMutate.builder(). Use the static factory method to create immutable instances: ImmutableProgramRandomMutate.of().

  • Field Details

    • populationMutationProbability

      private final double populationMutationProbability
  • Constructor Details

    • ImmutableProgramRandomMutate

      private ImmutableProgramRandomMutate(double populationMutationProbability)
  • Method Details

    • populationMutationProbability

      public double populationMutationProbability()
      Specified by:
      populationMutationProbability in interface ProgramRandomMutate
      Returns:
      The value of the populationMutationProbability attribute
    • withPopulationMutationProbability

      public final ImmutableProgramRandomMutate 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
    • equals

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

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

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

      public static ImmutableProgramRandomMutate of(double populationMutationProbability)
      Construct a new immutable ProgramRandomMutate instance.
      Parameters:
      populationMutationProbability - The value for the populationMutationProbability attribute
      Returns:
      An immutable ProgramRandomMutate instance
    • validate

      private static ImmutableProgramRandomMutate validate(ImmutableProgramRandomMutate instance)
    • copyOf

      public static ImmutableProgramRandomMutate copyOf(ProgramRandomMutate instance)
      Creates an immutable copy of a ProgramRandomMutate 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 ProgramRandomMutate instance
    • builder

      public static ImmutableProgramRandomMutate.Builder builder()
      Creates a builder for ImmutableProgramRandomMutate.
       ImmutableProgramRandomMutate.builder()
          .populationMutationProbability(double) // required populationMutationProbability
          .build();
       
      Returns:
      A new ImmutableProgramRandomMutate builder