Generator Utilities¶
fast_dominated_argsort(pop_f, pop_g=None)
¶
Performs a dominated sort on matrix of objective function values O. This is a numpy implementation of the algorithm described in [1].
A list of ranks is returned referencing each individual by its index in the objective matrix.
References
[1] Deb, K., Pratap, A., Agarwal, S., & Meyarivan, T. (2002). A fast and elitist multiobjective genetic algorithm: NSGA-II. IEEE Transactions on Evolutionary Computation, 6(2). https://doi.org/10.1109/4235.996017
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pop_f
|
ndarray
|
(M, N) numpy array where N is the number of individuals and M is the number of objectives |
required |
pop_g
|
ndarray
|
(M, N) numpy array where N is the number of individuals and M is the number of constraints, by default None |
None
|
Returns:
| Type | Description |
|---|---|
list
|
List of ranks where each rank is a list of the indices to the individuals in that rank |
Source code in xopt/generators/utils.py
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 | |
fast_dominated_argsort_internal(dom)
¶
Used inside of fast_dominated_argsort. Call that function instead.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dom
|
ndarray
|
The array of domination comparisons |
required |
Returns:
| Type | Description |
|---|---|
list
|
A list where each item is a set of the indices to the individuals contained in that domination rank |
Source code in xopt/generators/utils.py
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 | |
get_domination(pop_f, pop_g=None)
¶
Compute domination matrix for a population based on objective values and constraints. Determines domination relationships between all pairs of individuals in a population.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pop_f
|
ndarray
|
Objective function values for each individual in the population, shape (n_individuals, n_objectives) where lower values are better. |
required |
pop_g
|
ndarray
|
Constraint violation values for each individual, shape (n_individuals, n_constraints). Constraints are considered satisfied when <= 0.0. If None, unconstrained domination based solely on objectives is computed. |
None
|
Returns:
| Type | Description |
|---|---|
ndarray
|
Boolean domination matrix of shape (n_individuals, n_individuals), where dom[i,j] = True means individual i dominates individual j. |
Source code in xopt/generators/utils.py
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | |