Class ImmutableTarpeianMethod

java.lang.Object
net.bmahe.genetics4j.gp.postevaluationprocess.TarpeianMethod
net.bmahe.genetics4j.gp.postevaluationprocess.ImmutableTarpeianMethod
All Implemented Interfaces:
Function<Population<Double>,Population<Double>>

@Generated("org.immutables.processor.ProxyProcessor") public final class ImmutableTarpeianMethod extends TarpeianMethod
Immutable implementation of TarpeianMethod.

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

  • Field Details

    • randomGenerator

      private final RandomGenerator randomGenerator
    • sizeFunction

      private final Function<Genotype,Integer> sizeFunction
    • probability

      private final double probability
    • newValue

      private final double newValue
  • Constructor Details

  • Method Details

    • randomGenerator

      public RandomGenerator randomGenerator()
      Specified by:
      randomGenerator in class TarpeianMethod
      Returns:
      The value of the randomGenerator attribute
    • sizeFunction

      public Function<Genotype,Integer> sizeFunction()
      Specified by:
      sizeFunction in class TarpeianMethod
      Returns:
      The value of the sizeFunction attribute
    • probability

      public double probability()
      Specified by:
      probability in class TarpeianMethod
      Returns:
      The value of the probability attribute
    • newValue

      public double newValue()
      Specified by:
      newValue in class TarpeianMethod
      Returns:
      The value of the newValue attribute
    • withRandomGenerator

      public final ImmutableTarpeianMethod withRandomGenerator(RandomGenerator value)
      Copy the current immutable object by setting a value for the randomGenerator attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for randomGenerator
      Returns:
      A modified copy of the this object
    • withSizeFunction

      public final ImmutableTarpeianMethod withSizeFunction(Function<Genotype,Integer> value)
      Copy the current immutable object by setting a value for the sizeFunction attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for sizeFunction
      Returns:
      A modified copy of the this object
    • withProbability

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

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

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

      public int hashCode()
      Computes a hash code from attributes: randomGenerator, sizeFunction, probability, newValue.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

      public static ImmutableTarpeianMethod of(RandomGenerator randomGenerator, Function<Genotype,Integer> sizeFunction, double probability, double newValue)
      Construct a new immutable TarpeianMethod instance.
      Parameters:
      randomGenerator - The value for the randomGenerator attribute
      sizeFunction - The value for the sizeFunction attribute
      probability - The value for the probability attribute
      newValue - The value for the newValue attribute
      Returns:
      An immutable TarpeianMethod instance
    • validate

      private static ImmutableTarpeianMethod validate(ImmutableTarpeianMethod instance)
    • copyOf

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

      public static ImmutableTarpeianMethod.Builder builder()
      Creates a builder for ImmutableTarpeianMethod.
       ImmutableTarpeianMethod.builder()
          .randomGenerator(random.RandomGenerator) // required randomGenerator
          .sizeFunction(function.Function&lt;net.bmahe.genetics4j.core.Genotype, Integer&gt;) // required sizeFunction
          .probability(double) // required probability
          .newValue(double) // required newValue
          .build();
       
      Returns:
      A new ImmutableTarpeianMethod builder