Class ImmutableNeatChromosomeSpec.Builder

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

@Generated(from="NeatChromosomeSpec", generator="Immutables") public static class ImmutableNeatChromosomeSpec.Builder extends Object
Builds instances of type NeatChromosomeSpec. 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_NODE_LAYOUT

      private static final long INIT_BIT_NODE_LAYOUT
      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
    • nodeLayout

      private NeatNodeLayout nodeLayout
    • minWeightValue

      private float minWeightValue
    • maxWeightValue

      private float maxWeightValue
  • Constructor Details

    • Builder

      public Builder()
      Creates a builder for NeatChromosomeSpec instances.
      new NeatChromosomeSpec.Builder()
         .nodeLayout(net.bmahe.genetics4j.neat.spec.NeatNodeLayout) // required nodeLayout
         .minWeightValue(float) // required minWeightValue
         .maxWeightValue(float) // required maxWeightValue
         .build();
      
  • 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
    • nodeLayout

      public final NeatChromosomeSpec.Builder nodeLayout(NeatNodeLayout nodeLayout)
      Initializes the value for the nodeLayout attribute.
      Parameters:
      nodeLayout - The value for nodeLayout
      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

      public NeatChromosomeSpec build()
      Builds a new NeatChromosomeSpec.
      Returns:
      An immutable instance of NeatChromosomeSpec
      Throws:
      IllegalStateException - if any required attributes are missing
    • formatRequiredAttributesMessage

      private String formatRequiredAttributesMessage()