Class ImmutableNeatChromosomeSpec.Builder

java.lang.Object
net.bmahe.genetics4j.neat.spec.ImmutableNeatChromosomeSpec.Builder
Direct Known Subclasses:
NeatChromosomeSpec.Builder
Enclosing class:
ImmutableNeatChromosomeSpec

public static class ImmutableNeatChromosomeSpec.Builder extends Object
Builds instances of type ImmutableNeatChromosomeSpec. Initialize attributes and then invoke the build() method to create an immutable instance.

Builder is not thread-safe and generally should not be stored in a field or collection, but instead used immediately to create instances.

  • Field Details

    • INIT_BIT_NUM_INPUTS

      private static final long INIT_BIT_NUM_INPUTS
      See Also:
    • INIT_BIT_NUM_OUTPUTS

      private static final long INIT_BIT_NUM_OUTPUTS
      See Also:
    • INIT_BIT_MIN_WEIGHT_VALUE

      private static final long INIT_BIT_MIN_WEIGHT_VALUE
      See Also:
    • INIT_BIT_MAX_WEIGHT_VALUE

      private static final long INIT_BIT_MAX_WEIGHT_VALUE
      See Also:
    • initBits

      private long initBits
    • numInputs

      private int numInputs
    • numOutputs

      private int numOutputs
    • minWeightValue

      private float minWeightValue
    • maxWeightValue

      private float maxWeightValue
  • Constructor Details

  • Method Details

    • from

      public final NeatChromosomeSpec.Builder from(NeatChromosomeSpec instance)
      Fill a builder with attribute values from the provided NeatChromosomeSpec instance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values.
      Parameters:
      instance - The instance from which to copy values
      Returns:
      this builder for use in a chained invocation
    • numInputs

      public final NeatChromosomeSpec.Builder numInputs(int numInputs)
      Initializes the value for the numInputs attribute.
      Parameters:
      numInputs - The value for numInputs
      Returns:
      this builder for use in a chained invocation
    • numOutputs

      public final NeatChromosomeSpec.Builder numOutputs(int numOutputs)
      Initializes the value for the numOutputs attribute.
      Parameters:
      numOutputs - The value for numOutputs
      Returns:
      this builder for use in a chained invocation
    • minWeightValue

      public final NeatChromosomeSpec.Builder minWeightValue(float minWeightValue)
      Initializes the value for the minWeightValue attribute.
      Parameters:
      minWeightValue - The value for minWeightValue
      Returns:
      this builder for use in a chained invocation
    • maxWeightValue

      public final NeatChromosomeSpec.Builder maxWeightValue(float maxWeightValue)
      Initializes the value for the maxWeightValue attribute.
      Parameters:
      maxWeightValue - The value for maxWeightValue
      Returns:
      this builder for use in a chained invocation
    • build

      Returns:
      An immutable instance of NeatChromosomeSpec
      Throws:
      IllegalStateException - if any required attributes are missing
    • formatRequiredAttributesMessage

      private String formatRequiredAttributesMessage()