Class ImmutableDoubleTournament.Builder<T extends Comparable<T>>
java.lang.Object
net.bmahe.genetics4j.gp.spec.selection.ImmutableDoubleTournament.Builder<T>
- Enclosing class:
ImmutableDoubleTournament<T extends Comparable<T>>
@Generated(from="DoubleTournament",
generator="Immutables")
public static final class ImmutableDoubleTournament.Builder<T extends Comparable<T>>
extends Object
Builds instances of type
DoubleTournament.
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 booleanprivate Tournament<T> private static final longprivate static final longprivate static final longprivate longprivate static final longprivate longprivate Comparator<Individual<T>> private double -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds a newDoubleTournament.doFitnessFirst(boolean doFitnessFirst) Initializes the value for thedoFitnessFirstattribute.private booleanfitnessTournament(Tournament<T> fitnessTournament) Initializes the value for thefitnessTournamentattribute.private Stringfrom(DoubleTournament<T> instance) Fill a builder with attribute values from the providedDoubleTournamentinstance.parsimonyComparator(Comparator<Individual<T>> parsimonyComparator) Initializes the value for theparsimonyComparatorattribute.parsimonyTournamentSize(double parsimonyTournamentSize) Initializes the value for theparsimonyTournamentSizeattribute.
-
Field Details
-
INIT_BIT_FITNESS_TOURNAMENT
private static final long INIT_BIT_FITNESS_TOURNAMENT- See Also:
-
INIT_BIT_PARSIMONY_COMPARATOR
private static final long INIT_BIT_PARSIMONY_COMPARATOR- See Also:
-
INIT_BIT_PARSIMONY_TOURNAMENT_SIZE
private static final long INIT_BIT_PARSIMONY_TOURNAMENT_SIZE- See Also:
-
OPT_BIT_DO_FITNESS_FIRST
private static final long OPT_BIT_DO_FITNESS_FIRST- See Also:
-
initBits
private long initBits -
optBits
private long optBits -
fitnessTournament
-
parsimonyComparator
-
parsimonyTournamentSize
private double parsimonyTournamentSize -
doFitnessFirst
private boolean doFitnessFirst
-
-
Constructor Details
-
Builder
private Builder()
-
-
Method Details
-
from
Fill a builder with attribute values from the providedDoubleTournamentinstance. 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
-
fitnessTournament
public final ImmutableDoubleTournament.Builder<T> fitnessTournament(Tournament<T> fitnessTournament) Initializes the value for thefitnessTournamentattribute.- Parameters:
fitnessTournament- The value for fitnessTournament- Returns:
thisbuilder for use in a chained invocation
-
parsimonyComparator
public final ImmutableDoubleTournament.Builder<T> parsimonyComparator(Comparator<Individual<T>> parsimonyComparator) Initializes the value for theparsimonyComparatorattribute.- Parameters:
parsimonyComparator- The value for parsimonyComparator- Returns:
thisbuilder for use in a chained invocation
-
parsimonyTournamentSize
public final ImmutableDoubleTournament.Builder<T> parsimonyTournamentSize(double parsimonyTournamentSize) Initializes the value for theparsimonyTournamentSizeattribute.- Parameters:
parsimonyTournamentSize- The value for parsimonyTournamentSize- Returns:
thisbuilder for use in a chained invocation
-
doFitnessFirst
Initializes the value for thedoFitnessFirstattribute.If not set, this attribute will have a default value as returned by the initializer of
doFitnessFirst.- Parameters:
doFitnessFirst- The value for doFitnessFirst- Returns:
thisbuilder for use in a chained invocation
-
build
Builds a newDoubleTournament.- Returns:
- An immutable instance of DoubleTournament
- Throws:
IllegalStateException- if any required attributes are missing
-
doFitnessFirstIsSet
private boolean doFitnessFirstIsSet() -
formatRequiredAttributesMessage
-