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 Summary
FieldsModifier and TypeFieldDescriptionprivate static final longprivate static final longprivate static final longprivate longprivate floatprivate floatprivate NeatNodeLayout -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds a newNeatChromosomeSpec.private Stringfrom(NeatChromosomeSpec instance) Fill a builder with attribute values from the providedNeatChromosomeSpecinstance.maxWeightValue(float maxWeightValue) Initializes the value for themaxWeightValueattribute.minWeightValue(float minWeightValue) Initializes the value for theminWeightValueattribute.nodeLayout(NeatNodeLayout nodeLayout) Initializes the value for thenodeLayoutattribute.
-
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
-
minWeightValue
private float minWeightValue -
maxWeightValue
private float maxWeightValue
-
-
Constructor Details
-
Builder
public Builder()Creates a builder forNeatChromosomeSpecinstances.new NeatChromosomeSpec.Builder() .nodeLayout(net.bmahe.genetics4j.neat.spec.NeatNodeLayout) // required
nodeLayout.minWeightValue(float) // requiredminWeightValue.maxWeightValue(float) // requiredmaxWeightValue.build();
-
-
Method Details
-
from
Fill a builder with attribute values from the providedNeatChromosomeSpecinstance. 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
-
nodeLayout
Initializes the value for thenodeLayoutattribute.- Parameters:
nodeLayout- The value for nodeLayout- Returns:
thisbuilder for use in a chained invocation
-
minWeightValue
Initializes the value for theminWeightValueattribute.- Parameters:
minWeightValue- The value for minWeightValue- Returns:
thisbuilder for use in a chained invocation
-
maxWeightValue
Initializes the value for themaxWeightValueattribute.- Parameters:
maxWeightValue- The value for maxWeightValue- Returns:
thisbuilder for use in a chained invocation
-
build
Builds a newNeatChromosomeSpec.- Returns:
- An immutable instance of NeatChromosomeSpec
- Throws:
IllegalStateException- if any required attributes are missing
-
formatRequiredAttributesMessage
-