Class ImmutableNeatChromosomeSpec

java.lang.Object
net.bmahe.genetics4j.neat.spec.NeatChromosomeSpec
net.bmahe.genetics4j.neat.spec.ImmutableNeatChromosomeSpec
All Implemented Interfaces:
ChromosomeSpec

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

Use the builder to create immutable instances: new NeatChromosomeSpec.Builder(). Use the static factory method to create immutable instances: ImmutableNeatChromosomeSpec.of().

  • Field Details

    • numInputs

      private final int numInputs
    • numOutputs

      private final int numOutputs
    • minWeightValue

      private final float minWeightValue
    • maxWeightValue

      private final float maxWeightValue
  • Constructor Details

    • ImmutableNeatChromosomeSpec

      private ImmutableNeatChromosomeSpec(int numInputs, int numOutputs, float minWeightValue, float maxWeightValue)
  • Method Details

    • numInputs

      public int numInputs()
      Specified by:
      numInputs in class NeatChromosomeSpec
      Returns:
      The value of the numInputs attribute
    • numOutputs

      public int numOutputs()
      Specified by:
      numOutputs in class NeatChromosomeSpec
      Returns:
      The value of the numOutputs attribute
    • minWeightValue

      public float minWeightValue()
      Specified by:
      minWeightValue in class NeatChromosomeSpec
      Returns:
      The value of the minWeightValue attribute
    • maxWeightValue

      public float maxWeightValue()
      Specified by:
      maxWeightValue in class NeatChromosomeSpec
      Returns:
      The value of the maxWeightValue attribute
    • withNumInputs

      public final ImmutableNeatChromosomeSpec withNumInputs(int value)
      Copy the current immutable object by setting a value for the numInputs attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for numInputs
      Returns:
      A modified copy of the this object
    • withNumOutputs

      public final ImmutableNeatChromosomeSpec withNumOutputs(int value)
      Copy the current immutable object by setting a value for the numOutputs attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for numOutputs
      Returns:
      A modified copy of the this object
    • withMinWeightValue

      public final ImmutableNeatChromosomeSpec withMinWeightValue(float value)
      Copy the current immutable object by setting a value for the minWeightValue attribute. A value strict bits equality used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for minWeightValue
      Returns:
      A modified copy of the this object
    • withMaxWeightValue

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

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

      public int hashCode()
      Computes a hash code from attributes: numInputs, numOutputs, minWeightValue, maxWeightValue.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

      public static ImmutableNeatChromosomeSpec of(int numInputs, int numOutputs, float minWeightValue, float maxWeightValue)
      Construct a new immutable NeatChromosomeSpec instance.
      Parameters:
      numInputs - The value for the numInputs attribute
      numOutputs - The value for the numOutputs attribute
      minWeightValue - The value for the minWeightValue attribute
      maxWeightValue - The value for the maxWeightValue attribute
      Returns:
      An immutable NeatChromosomeSpec instance
    • validate

      private static ImmutableNeatChromosomeSpec validate(ImmutableNeatChromosomeSpec instance)
    • copyOf

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