Package net.bmahe.genetics4j.neat.spec
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 static final longprivate longprivate floatprivate floatprivate intprivate int -
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.numInputs(int numInputs) Initializes the value for thenumInputsattribute.numOutputs(int numOutputs) Initializes the value for thenumOutputsattribute.
-
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
-
Builder
public Builder()Creates a builder forNeatChromosomeSpecinstances.new NeatChromosomeSpec.Builder() .numInputs(int) // requirednumInputs.numOutputs(int) // requirednumOutputs.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
-
numInputs
Initializes the value for thenumInputsattribute.- Parameters:
numInputs- The value for numInputs- Returns:
thisbuilder for use in a chained invocation
-
numOutputs
Initializes the value for thenumOutputsattribute.- Parameters:
numOutputs- The value for numOutputs- 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
-