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 long
private static final long
private static final long
private long
private Comparator
<Individual<T>> private float
private Tournament
<T> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds a newSelectiveRefinementTournament
.private String
from
(SelectiveRefinementTournament<T> instance) Fill a builder with attribute values from the providedSelectiveRefinementTournament
instance.refinementComparator
(Comparator<Individual<T>> refinementComparator) Initializes the value for therefinementComparator
attribute.refinementRatio
(float refinementRatio) Initializes the value for therefinementRatio
attribute.tournament
(Tournament<T> tournament) Initializes the value for thetournament
attribute.
-
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 forSelectiveRefinementTournament
instances.new SelectiveRefinementTournament.Builder<T>() .tournament(net.bmahe.genetics4j.core.spec.selection.Tournament<T>) // required
tournament
.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 providedSelectiveRefinementTournament
instance. 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:
this
builder for use in a chained invocation
-
tournament
Initializes the value for thetournament
attribute.- Parameters:
tournament
- The value for tournament- Returns:
this
builder for use in a chained invocation
-
refinementComparator
public final SelectiveRefinementTournament.Builder<T> refinementComparator(Comparator<Individual<T>> refinementComparator) Initializes the value for therefinementComparator
attribute.- Parameters:
refinementComparator
- The value for refinementComparator- Returns:
this
builder for use in a chained invocation
-
refinementRatio
Initializes the value for therefinementRatio
attribute.- Parameters:
refinementRatio
- The value for refinementRatio- Returns:
this
builder 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
-