Class ElitismSelector

java.lang.Object
org.opt4j.optimizer.ea.ElitismSelector
All Implemented Interfaces:
Selector

public class ElitismSelector extends Object implements Selector
The ElitismSelector is a single objective elitism select. If a multi-objective problem is optimized, the objectives are summed up to a single value.
  • Field Details

  • Constructor Details

    • ElitismSelector

      @Inject public ElitismSelector(Rand random)
      Constructs an ElitismSelector.
      Parameters:
      random - the random number generator
  • Method Details

    • getLames

      public Collection<Individual> getLames(int lambda, Collection<Individual> population)
      Description copied from interface: Selector
      Selects a subset of lambda Individuals and returns it as a new Collection. These individuals can be erased in the next generation.
      Specified by:
      getLames in interface Selector
      Parameters:
      lambda - the number of lames to select
      population - the list of individuals
      Returns:
      the worst lambda individuals
    • getParents

      public Collection<Individual> getParents(int mu, Collection<Individual> population)
      Description copied from interface: Selector
      Selects a subset of Individuals and returns it as a new Collection. These so called parents can be used to form the next generation.
      Specified by:
      getParents in interface Selector
      Parameters:
      mu - the number of parents to select
      population - the list of individuals
      Returns:
      the parents
    • calculateFitness

      protected void calculateFitness(Collection<Individual> population)
      Calculates the fitness of the Individuals: the sum of all double values (these always have to be minimized) of the objectives.
      Parameters:
      population -
    • init

      public void init(int maxsize)
      Description copied from interface: Selector
      Sets the maximal number of Individuals.
      Specified by:
      init in interface Selector
      Parameters:
      maxsize - the number of individuals