Survival

pymoode.survival

Rank and Crowding

class pymoode.survival.RankAndCrowding(nds=None, crowding_func='cd', rule=None)

A generalization of the NSGA-II survival operator that ranks individuals by dominance criteria and sorts the last front by some crowding metric.

For many-objective problems, try using ‘mnn’ or ‘2nn’.

For Bi-objective problems, ‘pcd’ is very effective.

Parameters:
ndsstr or None, optional

Pymoo type of non-dominated sorting. Defaults to None.

crowding_funcstr or callable, optional

Crowding metric. Options are:

  • ‘cd’: crowding distances

  • ‘pcd’ or ‘pruning-cd’: improved pruning based on crowding distances

  • ‘ce’: crowding entropy

  • ‘mnn’: M-Neaest Neighbors

  • ‘2nn’: 2-Neaest Neighbors

If callable, it has the form fun(F, n_remove=None, **kwargs) in which F (n, m) and must return metrics in a (n,) array.

The options ‘pcd’, ‘cd’, and ‘ce’ are recommended for two-objective problems, whereas ‘mnn’ and ‘2nn’ for many objective. When using ‘pcd’, ‘mnn’, or ‘2nn’, individuals are already eliminated in a ‘single’ manner. Due to Cython implementation, they are as fast as the corresponding ‘cd’, ‘mnn-fast’, or ‘2nn-fast’, although they can singnificantly improve diversity of solutions. Defaults to ‘cd’.

Methods

do

class pymoode.survival.ConstrRankAndCrowding(nds=None, crowding_func='cd', ranking=None)

The Rank and Crowding survival approach for handling constraints proposed on GDE3 by Kukkonen, S. & Lampinen, J. (2005).

Parameters:
ndsstr or None, optional

Pymoo type of non-dominated sorting. Defaults to None.

crowding_funcstr or callable, optional

Crowding metric. Options are:

  • ‘cd’: crowding distances

  • ‘pcd’ or ‘pruning-cd’: improved pruning based on crowding distances

  • ‘ce’: crowding entropy

  • ‘mnn’: M-Neaest Neighbors

  • ‘2nn’: 2-Neaest Neighbors

If callable, it has the form fun(F, n_remove=None, **kwargs) in which F (n, m) and must return metrics in a (n,) array.

The options ‘pcd’, ‘cd’, and ‘ce’ are recommended for two-objective problems, whereas ‘mnn’ and ‘2nn’ for many objective. When using ‘pcd’, ‘mnn’, or ‘2nn’, individuals are already eliminated in a ‘single’ manner. Due to Cython implementation, they are as fast as the corresponding ‘cd’, ‘mnn-fast’, or ‘2nn-fast’, although they can singnificantly improve diversity of solutions. Defaults to ‘cd’.

Methods

do

Replacement

class pymoode.survival.replacement.BaseReplacement(fitness: Survival | None = None)

Base class for Replacement survival

Parameters:
fitnessSurvival, optional

Survival used in ranking and fitness assignement, by default None

Methods

do(problem, pop, off[, return_indices, inplace])

Given a problem a parent population and offspring canditates return next generation.