Class SelectiveRefinementTournament<T extends Comparable<T>>
- Type Parameters:
T
- the fitness type, must be Comparable
- All Implemented Interfaces:
SelectionPolicy
- Direct Known Subclasses:
ImmutableSelectiveRefinementTournament
This selection mechanism first performs standard tournament selection, then applies a secondary refinement process using a custom comparator to a portion of the selected candidates. This allows for more sophisticated selection criteria beyond simple fitness-based comparison.
Algorithm Overview:
- Conduct standard tournament selection based on the configured tournament parameters
- Apply refinement using the provided comparator to a fraction of candidates (determined by refinementRatio)
- Return the refined selection results
Use Cases:
- Multi-objective optimization where secondary criteria matter
- Diversity preservation by considering genetic distance in refinement
- Age-based selection refinement in evolutionary strategies
- Custom fitness landscape exploration with domain-specific comparators
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
SelectiveRefinementTournament.Builder<T extends Comparable<T>>
Builder class for constructing SelectiveRefinementTournament instances. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <U extends Comparable<U>>
SelectiveRefinementTournament.Builder<U> builder()
void
check()
Validates the configuration parameters for this selection policy.abstract Comparator
<Individual<T>> Gets the comparator used for refining the selection results.abstract float
Gets the ratio of candidates that undergo refinement selection.abstract Tournament
<T> Gets the base tournament configuration used for initial selection.
-
Constructor Details
-
SelectiveRefinementTournament
public SelectiveRefinementTournament()
-
-
Method Details
-
tournament
Gets the base tournament configuration used for initial selection.This tournament defines the primary selection mechanism including the number of candidates per tournament and the comparison strategy for determining winners.
- Returns:
- the tournament configuration for initial selection
-
refinementComparator
Gets the comparator used for refining the selection results.This comparator is applied during the refinement phase to reorder or filter a subset of the initially selected individuals. It allows for secondary selection criteria beyond basic fitness comparison, such as diversity measures, age-based preferences, or multi-objective considerations.
- Returns:
- the comparator for refinement selection
-
refinementRatio
public abstract float refinementRatio()Gets the ratio of candidates that undergo refinement selection.This value determines what fraction of the initially selected candidates will be subject to the refinement process using the refinement comparator. A value of 0.0 means no refinement (equivalent to standard tournament), while 1.0 means all candidates undergo refinement.
- Returns:
- the refinement ratio, must be between 0.0 and 1.0 inclusive
-
check
@Check public void check()Validates the configuration parameters for this selection policy.Ensures that the refinement ratio is within the valid range of [0.0, 1.0]. This method is automatically called by the Immutables framework during object construction.
- Throws:
IllegalArgumentException
- if refinement ratio is not between 0.0 and 1.0 inclusive
-
builder
-