Class ImmutableNeatCombination.Builder

java.lang.Object
net.bmahe.genetics4j.neat.spec.combination.ImmutableNeatCombination.Builder
Direct Known Subclasses:
NeatCombination.Builder
Enclosing class:
ImmutableNeatCombination

public static class ImmutableNeatCombination.Builder extends Object
Builds instances of type ImmutableNeatCombination. 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

    • OPT_BIT_INHERITANCE_THRESOLD

      private static final long OPT_BIT_INHERITANCE_THRESOLD
      See Also:
    • OPT_BIT_REENABLE_GENE_INHERITANCE_THRESOLD

      private static final long OPT_BIT_REENABLE_GENE_INHERITANCE_THRESOLD
      See Also:
    • optBits

      private long optBits
    • inheritanceThresold

      private double inheritanceThresold
    • reenableGeneInheritanceThresold

      private double reenableGeneInheritanceThresold
    • parentComparisonPolicy

      private ParentComparisonPolicy parentComparisonPolicy
  • Constructor Details

  • Method Details

    • from

      public final NeatCombination.Builder from(NeatCombination instance)
      Fill a builder with attribute values from the provided NeatCombination 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
    • inheritanceThresold

      public final NeatCombination.Builder inheritanceThresold(double inheritanceThresold)
      Initializes the value for the inheritanceThresold attribute.

      If not set, this attribute will have a default value as returned by the initializer of inheritanceThresold.

      Parameters:
      inheritanceThresold - The value for inheritanceThresold
      Returns:
      this builder for use in a chained invocation
    • reenableGeneInheritanceThresold

      public final NeatCombination.Builder reenableGeneInheritanceThresold(double reenableGeneInheritanceThresold)
      Initializes the value for the reenableGeneInheritanceThresold attribute.

      If not set, this attribute will have a default value as returned by the initializer of reenableGeneInheritanceThresold.

      Parameters:
      reenableGeneInheritanceThresold - The value for reenableGeneInheritanceThresold
      Returns:
      this builder for use in a chained invocation
    • parentComparisonPolicy

      public final NeatCombination.Builder parentComparisonPolicy(ParentComparisonPolicy parentComparisonPolicy)
      Initializes the value for the parentComparisonPolicy attribute.

      If not set, this attribute will have a default value as returned by the initializer of parentComparisonPolicy.

      Parameters:
      parentComparisonPolicy - The value for parentComparisonPolicy
      Returns:
      this builder for use in a chained invocation
    • build

      public ImmutableNeatCombination build()
      Returns:
      An immutable instance of NeatCombination
      Throws:
      IllegalStateException - if any required attributes are missing
    • inheritanceThresoldIsSet

      private boolean inheritanceThresoldIsSet()
    • reenableGeneInheritanceThresoldIsSet

      private boolean reenableGeneInheritanceThresoldIsSet()