saealib.EpsilonDominanceComparator#

class saealib.EpsilonDominanceComparator(eps, mode='additive', direction=None, *, eps_cv=1e-06, eps_obj=1e-06, sorter=<function non_dominated_sort>)[source]#

Bases: ParetoComparator

Comparator using ε-box dominance instead of standard Pareto dominance.

Wraps EpsilonDominator and injects it into the ParetoComparator dominance seam via the dominator= argument. Front ranking, infeasibility handling, and constraint-domination logic are all inherited unchanged from ParetoComparator.

The ε-dominance relation is defined in:

Laumanns, M., Thiele, L., Deb, K., & Zitzler, E. (2002). Combining convergence and diversity in evolutionary multiobjective optimization. Evolutionary Computation, 10(3), 263-282.

Each objective axis is divided into ε-boxes of width eps. Two solutions that fall in the same ε-box are mutually non-dominating; a solution whose box index is strictly better in every objective dominates the other. As eps → 0 the relation recovers ordinary Pareto dominance.

Note

ε-box representative selection (the archive rule that keeps one solution per box — cf. Deb, Mohan & Mishra (2005), ε-MOEA) is not handled here. That is an archive-truncation responsibility and will be added separately.

Parameters:
  • eps (float or np.ndarray) – Box size(s). A scalar broadcasts to all objectives; an array of shape (n_obj,) sets per-objective widths. All values must be strictly positive (> 0).

  • mode ({"additive", "multiplicative"}) – Quantization mode passed to EpsilonDominator. "additive" (default): box index = floor(f_i / eps_i). "multiplicative": box index = floor(log f_i / log(1 + eps_i)); requires strictly positive objective values.

  • direction (np.ndarray or None) – See ParetoComparator.

  • eps_cv (float) – See ParetoComparator.

  • eps_obj (float) – See ParetoComparator.

  • sorter (NonDominatedSorter) – See ParetoComparator.

Methods

__init__

compare

Compare two solutions directly without a Population object.

compare_population

Compare via Pareto dominance; -1=a dominates, 1=b dominates, 0=equal.

get_required_attrs

Return population attributes this comparator needs to persist.

prepare_population

Freshly recompute and materialize population-relative ranking state.

rank_population

Prepare population-relative ranking state, then sort.

sort_population

Sort by Pareto front rank; infeasible individuals come last.

Method Details

EpsilonDominanceComparator.__init__(eps, mode='additive', direction=None, *, eps_cv=1e-06, eps_obj=1e-06, sorter=<function non_dominated_sort>)[source]#
Parameters:
  • eps (float | ndarray)

  • mode (str)

  • direction (ndarray | None)

  • eps_cv (float)

  • eps_obj (float)

  • sorter (NonDominatedSorter)

EpsilonDominanceComparator.compare(fa, cv_a, fb, cv_b)#

Compare two solutions directly without a Population object.

Parameters:
  • fa (ndarray)

  • cv_a (float)

  • fb (ndarray)

  • cv_b (float)

Return type:

int

EpsilonDominanceComparator.compare_population(population, idx_a, idx_b)#

Compare via Pareto dominance; -1=a dominates, 1=b dominates, 0=equal.

Parameters:
Return type:

int

EpsilonDominanceComparator.get_required_attrs(problem)#

Return population attributes this comparator needs to persist.

Population-relative ranking state (e.g. SPEA2 fitness) that must survive across selections belongs here as a named, typed attribute rather than in the population’s transient cache. Default: no additional attributes.

Parameters:

problem (Problem) – The optimization problem.

Returns:

Empty by default.

Return type:

list[PopulationAttribute]

EpsilonDominanceComparator.prepare_population(population)#

Freshly recompute and materialize population-relative ranking state.

Default is a no-op — comparators whose ranking depends only on per-individual values already stored in f/cv do not need this. Comparators that declare attributes via get_required_attrs() should override this to recompute and write those attributes for the given population, unconditionally (not reusing any prior cached value).

Parameters:

population (Population) – The population to prepare ranking state for.

Return type:

None

EpsilonDominanceComparator.rank_population(population)#

Prepare population-relative ranking state, then sort.

Equivalent to calling prepare_population() followed by sort_population(). Callers performing environmental selection on a freshly assembled pool (e.g. survivor selection merging population and offspring) should call this instead of sort_population() directly, so any population-relative state declared via get_required_attrs() is recomputed for the new set before ranking.

Parameters:

population (Population) – The population to rank.

Returns:

Sorted population indices, as returned by sort_population().

Return type:

np.ndarray

EpsilonDominanceComparator.sort_population(population)#

Sort by Pareto front rank; infeasible individuals come last.

Parameters:

population (Population)

Return type:

np.ndarray