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
  • Constructor Details

    • SPEA2Replacement

      public SPEA2Replacement()
  • Method Details

    • dominance

      @Default public Comparator<T> dominance()
      Defines the Pareto dominance relation
      Returns:
    • deduplicate

      @Default public Optional<Comparator<Genotype>> deduplicate()
      Comparator used for deduplication of solution prior to processing

      If not specified, it defaults to not do any deduplication

      Returns:
    • k

      @Default public Optional<Integer> k()
      Determine the k-nearest distance to compute.

      It will default to sqrt(|archive| + |population|)

      Returns:
    • distance

      @Parameter public abstract BiFunction<T,T,Double> distance()
      Define how to compute distances in objective space between two solutions
      Returns:
      Distance
    • builder

      public static <U extends Comparable<U>> SPEA2Replacement.Builder<U> 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