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 Summary

    Constructors
    Constructor
    Description
    Constructs a new fitness evaluator for computing the strength measure with crowding-based niching.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Returns true if larger fitness values are preferred; otherwise smaller fitness values are preferred.
    void
    evaluate(Population population)
    Evaluates the fitness of solutions in the population, updating the Fitness attribute.
    int
    Returns the value k that controls which nearest neighbor is used to compute the crowding distance.
    void
    setK(int k)
    Sets the value k that controls which nearest neighbor is used to compute the crowding distance.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.moeaframework.core.configuration.Configurable

    applyConfiguration, getConfiguration
  • 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 fitness of solutions in the population, updating the Fitness 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