Class Nsga2

  • All Implemented Interfaces:
    Selector
    Direct Known Subclasses:
    SelectorDefault

    public class Nsga2
    extends Object
    implements Selector
    See Also:
    Nsga2Module, "A Fast Elitist Non-Dominated Sorting Genetic Algorithm for Multi-Objective Optimization: NSGA-II, K. Deb, Samir Agrawal, Amrit Pratap, and T. Meyarivan, Parallel MockProblem Solving from Nature, 2000"
    • Constructor Detail

      • Nsga2

        @Inject
        public Nsga2​(Rand random,
                     int tournament,
                     FrontDensityIndicator indicator)
        Constructs a Nsga2 Selector.
        Parameters:
        random - the random number generator
        tournament - the tournament value
    • Method Detail

      • 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
      • 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
      • getLames

        public Collection<Individual> getLames​(int n,
                                               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:
        n - the number of lames to select
        population - the list of individuals
        Returns:
        the worst lambda individuals
      • fronts

        public List<List<Individual>> fronts​(Collection<Individual> individuals)
        Evaluate the fronts and set the correspondent rank values.
        Parameters:
        individuals - the individuals
        Returns:
        the fronts