Class ImmutableTarpeianMethod.Builder
java.lang.Object
net.bmahe.genetics4j.gp.postevaluationprocess.ImmutableTarpeianMethod.Builder
- Enclosing class:
ImmutableTarpeianMethod
@Generated(from="TarpeianMethod",
generator="Immutables")
public static final class ImmutableTarpeianMethod.Builder
extends Object
Builds instances of type
TarpeianMethod.
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 doubleprivate doubleprivate RandomGenerator -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds a newTarpeianMethod.private Stringfrom(TarpeianMethod instance) Fill a builder with attribute values from the providedTarpeianMethodinstance.newValue(double newValue) Initializes the value for thenewValueattribute.probability(double probability) Initializes the value for theprobabilityattribute.randomGenerator(RandomGenerator randomGenerator) Initializes the value for therandomGeneratorattribute.sizeFunction(Function<Genotype, Integer> sizeFunction) Initializes the value for thesizeFunctionattribute.
-
Field Details
-
INIT_BIT_RANDOM_GENERATOR
private static final long INIT_BIT_RANDOM_GENERATOR- See Also:
-
INIT_BIT_SIZE_FUNCTION
private static final long INIT_BIT_SIZE_FUNCTION- See Also:
-
INIT_BIT_PROBABILITY
private static final long INIT_BIT_PROBABILITY- See Also:
-
INIT_BIT_NEW_VALUE
private static final long INIT_BIT_NEW_VALUE- See Also:
-
initBits
private long initBits -
randomGenerator
-
sizeFunction
-
probability
private double probability -
newValue
private double newValue
-
-
Constructor Details
-
Builder
private Builder()
-
-
Method Details
-
from
Fill a builder with attribute values from the providedTarpeianMethodinstance. 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
-
randomGenerator
Initializes the value for therandomGeneratorattribute.- Parameters:
randomGenerator- The value for randomGenerator- Returns:
thisbuilder for use in a chained invocation
-
sizeFunction
Initializes the value for thesizeFunctionattribute.- Parameters:
sizeFunction- The value for sizeFunction- Returns:
thisbuilder for use in a chained invocation
-
probability
Initializes the value for theprobabilityattribute.- Parameters:
probability- The value for probability- Returns:
thisbuilder for use in a chained invocation
-
newValue
Initializes the value for thenewValueattribute.- Parameters:
newValue- The value for newValue- Returns:
thisbuilder for use in a chained invocation
-
build
Builds a newTarpeianMethod.- Returns:
- An immutable instance of TarpeianMethod
- Throws:
IllegalStateException- if any required attributes are missing
-
formatRequiredAttributesMessage
-