Class ImmutableNeatConnectionWeight.Builder
java.lang.Object
net.bmahe.genetics4j.neat.spec.mutation.ImmutableNeatConnectionWeight.Builder
- Direct Known Subclasses:
NeatConnectionWeight.Builder
- Enclosing class:
ImmutableNeatConnectionWeight
@Generated(from="NeatConnectionWeight",
generator="Immutables")
public static class ImmutableNeatConnectionWeight.Builder
extends Object
Builds instances of type
NeatConnectionWeight.
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 Distributionprivate static final longprivate static final longprivate longprivate Distributionprivate doubleprivate double -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds a newNeatConnectionWeight.from(NeatConnectionWeight instance) Fill a builder with attribute values from the providedNeatConnectionWeightinstance.newValuesDistribution(Distribution newValuesDistribution) Initializes the value for thenewValuesDistributionattribute.perturbationDistribution(Distribution perturbationDistribution) Initializes the value for theperturbationDistributionattribute.perturbationRatio(double perturbationRatio) Initializes the value for theperturbationRatioattribute.private booleanpopulationMutationProbability(double populationMutationProbability) Initializes the value for thepopulationMutationProbabilityattribute.private boolean
-
Field Details
-
OPT_BIT_POPULATION_MUTATION_PROBABILITY
private static final long OPT_BIT_POPULATION_MUTATION_PROBABILITY- See Also:
-
OPT_BIT_PERTURBATION_RATIO
private static final long OPT_BIT_PERTURBATION_RATIO- See Also:
-
optBits
private long optBits -
populationMutationProbability
private double populationMutationProbability -
perturbationRatio
private double perturbationRatio -
perturbationDistribution
-
newValuesDistribution
-
-
Constructor Details
-
Builder
public Builder()Creates a builder forNeatConnectionWeightinstances.new NeatConnectionWeight.Builder() .populationMutationProbability(double) // optionalpopulationMutationProbability.perturbationRatio(double) // optionalperturbationRatio.perturbationDistribution(net.bmahe.genetics4j.core.spec.statistics.distributions.Distribution) // optionalperturbationDistribution.newValuesDistribution(net.bmahe.genetics4j.core.spec.statistics.distributions.Distribution) // optionalnewValuesDistribution.build();
-
-
Method Details
-
from
Fill a builder with attribute values from the providedNeatConnectionWeightinstance. 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
-
populationMutationProbability
public final NeatConnectionWeight.Builder populationMutationProbability(double populationMutationProbability) Initializes the value for thepopulationMutationProbabilityattribute.If not set, this attribute will have a default value as returned by the initializer of
populationMutationProbability.- Parameters:
populationMutationProbability- The value for populationMutationProbability- Returns:
thisbuilder for use in a chained invocation
-
perturbationRatio
Initializes the value for theperturbationRatioattribute.If not set, this attribute will have a default value as returned by the initializer of
perturbationRatio.- Parameters:
perturbationRatio- The value for perturbationRatio- Returns:
thisbuilder for use in a chained invocation
-
perturbationDistribution
public final NeatConnectionWeight.Builder perturbationDistribution(Distribution perturbationDistribution) Initializes the value for theperturbationDistributionattribute.If not set, this attribute will have a default value as returned by the initializer of
perturbationDistribution.- Parameters:
perturbationDistribution- The value for perturbationDistribution- Returns:
thisbuilder for use in a chained invocation
-
newValuesDistribution
Initializes the value for thenewValuesDistributionattribute.If not set, this attribute will have a default value as returned by the initializer of
newValuesDistribution.- Parameters:
newValuesDistribution- The value for newValuesDistribution- Returns:
thisbuilder for use in a chained invocation
-
build
Builds a newNeatConnectionWeight.- Returns:
- An immutable instance of NeatConnectionWeight
- Throws:
IllegalStateException- if any required attributes are missing
-
populationMutationProbabilityIsSet
private boolean populationMutationProbabilityIsSet() -
perturbationRatioIsSet
private boolean perturbationRatioIsSet()
-