Class ImmutableSelectiveRefinementTournament.Builder<T extends Comparable<T>>
java.lang.Object
net.bmahe.genetics4j.core.spec.selection.ImmutableSelectiveRefinementTournament.Builder<T>
- Direct Known Subclasses:
SelectiveRefinementTournament.Builder
- Enclosing class:
ImmutableSelectiveRefinementTournament<T extends Comparable<T>>
@Generated(from="SelectiveRefinementTournament",
generator="Immutables")
public static class ImmutableSelectiveRefinementTournament.Builder<T extends Comparable<T>>
extends Object
Builds instances of type
SelectiveRefinementTournament.
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 Comparator<Individual<T>> private floatprivate Tournament<T> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds a newSelectiveRefinementTournament.private Stringfrom(SelectiveRefinementTournament<T> instance) Fill a builder with attribute values from the providedSelectiveRefinementTournamentinstance.refinementComparator(Comparator<Individual<T>> refinementComparator) Initializes the value for therefinementComparatorattribute.refinementRatio(float refinementRatio) Initializes the value for therefinementRatioattribute.tournament(Tournament<T> tournament) Initializes the value for thetournamentattribute.
-
Field Details
-
INIT_BIT_TOURNAMENT
private static final long INIT_BIT_TOURNAMENT- See Also:
-
INIT_BIT_REFINEMENT_COMPARATOR
private static final long INIT_BIT_REFINEMENT_COMPARATOR- See Also:
-
INIT_BIT_REFINEMENT_RATIO
private static final long INIT_BIT_REFINEMENT_RATIO- See Also:
-
initBits
private long initBits -
tournament
-
refinementComparator
-
refinementRatio
private float refinementRatio
-
-
Constructor Details
-
Builder
public Builder()Creates a builder forSelectiveRefinementTournamentinstances.new SelectiveRefinementTournament.Builder<T>() .tournament(net.bmahe.genetics4j.core.spec.selection.Tournament<T>) // requiredtournament.refinementComparator(Comparator<net.bmahe.genetics4j.core.Individual<T>>) // requiredrefinementComparator.refinementRatio(float) // requiredrefinementRatio.build();
-
-
Method Details
-
from
public final SelectiveRefinementTournament.Builder<T> from(SelectiveRefinementTournament<T> instance) Fill a builder with attribute values from the providedSelectiveRefinementTournamentinstance. 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
-
tournament
Initializes the value for thetournamentattribute.- Parameters:
tournament- The value for tournament- Returns:
thisbuilder for use in a chained invocation
-
refinementComparator
public final SelectiveRefinementTournament.Builder<T> refinementComparator(Comparator<Individual<T>> refinementComparator) Initializes the value for therefinementComparatorattribute.- Parameters:
refinementComparator- The value for refinementComparator- Returns:
thisbuilder for use in a chained invocation
-
refinementRatio
Initializes the value for therefinementRatioattribute.- Parameters:
refinementRatio- The value for refinementRatio- Returns:
thisbuilder for use in a chained invocation
-
build
Builds a newSelectiveRefinementTournament.- Returns:
- An immutable instance of SelectiveRefinementTournament
- Throws:
IllegalStateException- if any required attributes are missing
-
formatRequiredAttributesMessage
-