Class SPEA2.StrengthFitnessEvaluator

java.lang.Object
org.moeaframework.algorithm.SPEA2.StrengthFitnessEvaluator
All Implemented Interfaces:
Configurable, FitnessEvaluator
Enclosing class:
SPEA2

public class SPEA2.StrengthFitnessEvaluator extends Object implements FitnessEvaluator, Configurable
Fitness evaluator for the strength measure with crowding-based niching.
  • Constructor Details

    • StrengthFitnessEvaluator

      public StrengthFitnessEvaluator(int k)
      Constructs a new fitness evaluator for computing the strength measure with crowding-based niching.
      Parameters:
      k - crowding is based on the distance to the k-th nearest neighbor
  • Method Details

    • getK

      public int getK()
      Returns the value k that controls which nearest neighbor is used to compute the crowding distance.
      Returns:
      the value k
    • setK

      public void setK(int k)
      Sets the value k that controls which nearest neighbor is used to compute the crowding distance. This is set to 1 by default.
      Parameters:
      k - the value k
    • evaluate

      public void evaluate(Population population)
      Description copied from interface: FitnessEvaluator
      Evaluates the solutions in the specified population assigning the FITNESS_ATTRIBUTE attribute.
      Specified by:
      evaluate in interface FitnessEvaluator
      Parameters:
      population - the population to be evaluated
    • areLargerValuesPreferred

      public boolean areLargerValuesPreferred()
      Description copied from interface: FitnessEvaluator
      Returns true if larger fitness values are preferred; otherwise smaller fitness values are preferred.
      Specified by:
      areLargerValuesPreferred in interface FitnessEvaluator
      Returns:
      true if larger fitness values are preferred; otherwise smaller fitness values are preferred