Class SPEA2Replacement<T extends Comparable<T>>
java.lang.Object
net.bmahe.genetics4j.moo.spea2.spec.replacement.SPEA2Replacement<T>
- All Implemented Interfaces:
ReplacementStrategy
- Direct Known Subclasses:
ImmutableSPEA2Replacement
@Immutable
public abstract class SPEA2Replacement<T extends Comparable<T>>
extends Object
implements ReplacementStrategy
-
Nested Class Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <U extends Comparable<U>>
SPEA2Replacement.Builder<U> builder()
Comparator used for deduplication of solution prior to processingabstract BiFunction
<T, T, Double> distance()
Define how to compute distances in objective space between two solutionsDefines the Pareto dominance relationk()
Determine the k-nearest distance to compute.static <U extends Number & Comparable<U>>
SPEA2Replacement<FitnessVector<U>> Factory method to instantiate a SPEA2Selection when fitness is defined as a FitnessVector of a Numberstatic <U extends Number & Comparable<U>>
SPEA2Replacement<FitnessVector<U>> ofFitnessVector
(Comparator<Genotype> deduplicate) Factory method to instantiate a SPEA2Selection when fitness is defined as a FitnessVector of a Number
-
Constructor Details
-
SPEA2Replacement
public SPEA2Replacement()
-
-
Method Details
-
dominance
Defines the Pareto dominance relation- Returns:
-
deduplicate
Comparator used for deduplication of solution prior to processingIf not specified, it defaults to not do any deduplication
- Returns:
-
k
Determine the k-nearest distance to compute.It will default to sqrt(|archive| + |population|)
- Returns:
-
distance
Define how to compute distances in objective space between two solutions- Returns:
- Distance
-
builder
-
ofFitnessVector
public static <U extends Number & Comparable<U>> SPEA2Replacement<FitnessVector<U>> ofFitnessVector(Comparator<Genotype> deduplicate) Factory method to instantiate a SPEA2Selection when fitness is defined as a FitnessVector of a Number- Type Parameters:
U
- Type of the fitness measurement- Parameters:
deduplicate
- Deduplicator comparator. Null value with disable deduplication- Returns:
- A new instance of SPEA2Replacement
-
ofFitnessVector
public static <U extends Number & Comparable<U>> SPEA2Replacement<FitnessVector<U>> ofFitnessVector()Factory method to instantiate a SPEA2Selection when fitness is defined as a FitnessVector of a Number- Type Parameters:
U
- Type of the fitness measurement- Returns:
- A new instance of SPEA2Replacement
-