Class ImmutableNeatCombination.Builder
java.lang.Object
net.bmahe.genetics4j.neat.spec.combination.ImmutableNeatCombination.Builder
- Direct Known Subclasses:
NeatCombination.Builder
- Enclosing class:
ImmutableNeatCombination
@Generated(from="NeatCombination",
generator="Immutables")
public static class ImmutableNeatCombination.Builder
extends Object
Builds instances of type
NeatCombination.
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 Summary
FieldsModifier and TypeFieldDescriptionprivate doubleprivate static final longprivate static final longprivate longprivate ParentComparisonPolicyprivate double -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds a newNeatCombination.final NeatCombination.Builderfrom(NeatCombination instance) Fill a builder with attribute values from the providedNeatCombinationinstance.final NeatCombination.BuilderinheritanceThresold(double inheritanceThresold) Initializes the value for theinheritanceThresoldattribute.private booleanfinal NeatCombination.BuilderparentComparisonPolicy(ParentComparisonPolicy parentComparisonPolicy) Initializes the value for theparentComparisonPolicyattribute.final NeatCombination.BuilderreenableGeneInheritanceThresold(double reenableGeneInheritanceThresold) Initializes the value for thereenableGeneInheritanceThresoldattribute.private boolean
-
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
-
-
Constructor Details
-
Builder
public Builder()Creates a builder forNeatCombinationinstances.new NeatCombination.Builder() .inheritanceThresold(double) // optionalinheritanceThresold.reenableGeneInheritanceThresold(double) // optionalreenableGeneInheritanceThresold.parentComparisonPolicy(net.bmahe.genetics4j.neat.spec.combination.parentcompare.ParentComparisonPolicy) // optionalparentComparisonPolicy.build();
-
-
Method Details
-
from
Fill a builder with attribute values from the providedNeatCombinationinstance. 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:
thisbuilder for use in a chained invocation
-
inheritanceThresold
Initializes the value for theinheritanceThresoldattribute.If not set, this attribute will have a default value as returned by the initializer of
inheritanceThresold.- Parameters:
inheritanceThresold- The value for inheritanceThresold- Returns:
thisbuilder for use in a chained invocation
-
reenableGeneInheritanceThresold
public final NeatCombination.Builder reenableGeneInheritanceThresold(double reenableGeneInheritanceThresold) Initializes the value for thereenableGeneInheritanceThresoldattribute.If not set, this attribute will have a default value as returned by the initializer of
reenableGeneInheritanceThresold.- Parameters:
reenableGeneInheritanceThresold- The value for reenableGeneInheritanceThresold- Returns:
thisbuilder for use in a chained invocation
-
parentComparisonPolicy
public final NeatCombination.Builder parentComparisonPolicy(ParentComparisonPolicy parentComparisonPolicy) Initializes the value for theparentComparisonPolicyattribute.If not set, this attribute will have a default value as returned by the initializer of
parentComparisonPolicy.- Parameters:
parentComparisonPolicy- The value for parentComparisonPolicy- Returns:
thisbuilder for use in a chained invocation
-
build
Builds a newNeatCombination.- Returns:
- An immutable instance of NeatCombination
- Throws:
IllegalStateException- if any required attributes are missing
-
inheritanceThresoldIsSet
private boolean inheritanceThresoldIsSet() -
reenableGeneInheritanceThresoldIsSet
private boolean reenableGeneInheritanceThresoldIsSet()
-