saealib.ParetoDominator#
- class saealib.ParetoDominator[source]#
Bases:
DominatorPareto dominance predicate.
fadominatesfbifffais at most as large asfbin all objectives and strictly smaller in at least one (after applying the direction transform).This is the default dominance relation used throughout the library.
Methods
Compute the NxN Pareto-dominance matrix. |
|
Return True if fa dominates fb. |
|
Compute one-vs-many Pareto dominance via a single O(n) broadcast. |
Method Details
- ParetoDominator.__init__()#
- ParetoDominator.dominance_matrix(f, direction=None)[source]#
Compute the NxN Pareto-dominance matrix.
Applies the
f * (-direction)transform so that smaller is always better, then accumulates per-objectiveleq_all/less_anycomparisons. Peak memory is O(N²); no (N, N, M) tensor is created.- Parameters:
f (np.ndarray) – Objective matrix. shape: (n, n_obj). Must contain no NaN values.
direction (np.ndarray or None) – Per-objective direction.
None→ minimize all.
- Returns:
Boolean matrix of shape (n, n).
D[i, j]= True iff row i Pareto-dominates row j.- Return type:
np.ndarray
- ParetoDominator.dominates(fa, fb, direction=None)#
Return True if fa dominates fb.
Derived from
dominates_manywith a single-row objective matrix. NaN values in fa always return False. NaN values in fb are treated as infinitely bad.- Parameters:
fa (np.ndarray) – Objective vectors. shape: (n_obj,)
fb (np.ndarray) – Objective vectors. shape: (n_obj,)
direction (np.ndarray or None) – Per-objective direction.
None→ minimize all.
- Return type:
bool
- ParetoDominator.dominates_many(fa, f_matrix, direction=None)[source]#
Compute one-vs-many Pareto dominance via a single O(n) broadcast.
- Parameters:
fa (np.ndarray) – shape: (n_obj,)
f_matrix (np.ndarray) – shape: (n, n_obj). Must contain no NaN values.
direction (np.ndarray or None) – Per-objective direction.
None-> minimize all.
- Returns:
(fa_dominates, dominates_fa), each shape(n,).- Return type:
tuple[np.ndarray, np.ndarray]