saealib.RNSGA2Comparator#
- class saealib.RNSGA2Comparator(reference_points, epsilon=0.001, direction=None, *, eps_cv=1e-06, eps_obj=1e-06, sorter=<function non_dominated_sort>, dominator=None)[ソース]#
ベースクラス:
ParetoComparatorComparator for multi-objective optimization via R-NSGA-II style ranking.
Extends ParetoComparator with reference-point-based secondary ordering:
sort_population: non-dominated sorting + reference-point proximity ordering
compare_population: overrides ParetoComparator with rank + reference-point distance: lower rank wins, ties broken by smaller distance to the nearest reference point -- see
compare_population()
The R-NSGA-II selection mechanism (Deb & Sundar 2006):
Non-dominated sorting (same fronts as NSGA-II).
Normalize objectives by range (min-max per objective).
Step 1: for each reference point, compute the normalized Euclidean distance of every individual in the front to that point and rank them ascending (closest = rank 1).
Step 2: each individual's crowding-distance-equivalent is the minimum of its per-reference-point ranks from Step 1 (smaller = preferred).
Step 3 (ε-clearing): solutions within
epsilonof a higher-ranked solution sharing the same nearest reference point are moved to the back of their reference-point group.
- パラメータ:
reference_points (np.ndarray) -- Shape
(n_ref, n_obj). User-supplied reference points (aspiration points) in the objective space. Unlike NSGA-III, these need not lie on the unit simplex.epsilon (float) -- ε-clearing radius in normalized objective space. Solutions within
epsilonof a better-ranked solution sharing the same reference point are deprioritized.direction (np.ndarray or None) -- Per-objective optimization directions (
+1maximize,-1minimize).Nonemeans all objectives are minimized.eps_cv (float) -- Constraint-violation tolerance.
eps_obj (float) -- Objective tolerance (passed to base class).
sorter (NonDominatedSorter) -- Non-dominated sorting callable.
dominator (Dominator or None) -- Dominance predicate.
参照
[8]: Deb, K., & Sundar, J. (2006). Reference Point Based Multi-Objective Optimization Using Evolutionary Algorithms. Proceedings of GECCO 2006, 635-642.
Methods
Compare two solutions directly without a Population object. |
|
Compare via R-NSGA-II operator: rank first, then reference-point distance. |
|
Return population attributes this comparator needs to persist. |
|
Freshly recompute and materialize population-relative ranking state. |
|
Prepare population-relative ranking state, then sort. |
|
Sort by Pareto front rank then reference-point proximity (R-NSGA-II). |
Method Details
- RNSGA2Comparator.__init__(reference_points, epsilon=0.001, direction=None, *, eps_cv=1e-06, eps_obj=1e-06, sorter=<function non_dominated_sort>, dominator=None)[ソース]#
- パラメータ:
reference_points (ndarray)
epsilon (float)
direction (ndarray | None)
eps_cv (float)
eps_obj (float)
sorter (NonDominatedSorter)
dominator (Dominator | None)
- 戻り値の型:
None
- RNSGA2Comparator.compare(fa, cv_a, fb, cv_b)#
Compare two solutions directly without a Population object.
- パラメータ:
fa (ndarray)
cv_a (float)
fb (ndarray)
cv_b (float)
- 戻り値の型:
int
- RNSGA2Comparator.compare_population(population, idx_a, idx_b)[ソース]#
Compare via R-NSGA-II operator: rank first, then reference-point distance.
Lower rank wins; within the same rank, closer to the nearest reference point wins (smaller distance is better, opposite of NSGA-II crowding distance). Infeasibility is handled with the standard constraint- domination rule (Deb 2000).
- パラメータ:
population (Population)
idx_a (int)
idx_b (int)
- 戻り値の型:
int
- RNSGA2Comparator.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.
- パラメータ:
problem (Problem) -- The optimization problem.
- 戻り値:
Empty by default.
- 戻り値の型:
list[PopulationAttribute]
- RNSGA2Comparator.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/cvdo not need this. Comparators that declare attributes viaget_required_attrs()should override this to recompute and write those attributes for the given population, unconditionally (not reusing any prior cached value).- パラメータ:
population (Population) -- The population to prepare ranking state for.
- 戻り値の型:
None
- RNSGA2Comparator.rank_population(population)#
Prepare population-relative ranking state, then sort.
Equivalent to calling
prepare_population()followed bysort_population(). Callers performing environmental selection on a freshly assembled pool (e.g. survivor selection merging population and offspring) should call this instead ofsort_population()directly, so any population-relative state declared viaget_required_attrs()is recomputed for the new set before ranking.- パラメータ:
population (Population) -- The population to rank.
- 戻り値:
Sorted population indices, as returned by
sort_population().- 戻り値の型:
np.ndarray
- RNSGA2Comparator.sort_population(population)[ソース]#
Sort by Pareto front rank then reference-point proximity (R-NSGA-II).
- パラメータ:
population (Population)
- 戻り値の型:
np.ndarray