pymoo 0.6.1.3__cp311-cp311-macosx_10_9_universal2.whl → 0.6.1.5.dev0__cp311-cp311-macosx_10_9_universal2.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of pymoo might be problematic. Click here for more details.

Files changed (57) hide show
  1. pymoo/algorithms/moo/age.py +13 -7
  2. pymoo/algorithms/moo/age2.py +49 -19
  3. pymoo/algorithms/moo/ctaea.py +2 -2
  4. pymoo/algorithms/moo/kgb.py +9 -9
  5. pymoo/algorithms/moo/nsga3.py +2 -2
  6. pymoo/algorithms/moo/pinsga2.py +370 -0
  7. pymoo/algorithms/moo/rnsga3.py +2 -2
  8. pymoo/algorithms/soo/nonconvex/es.py +3 -2
  9. pymoo/config.py +1 -1
  10. pymoo/core/algorithm.py +1 -1
  11. pymoo/core/individual.py +8 -7
  12. pymoo/core/replacement.py +5 -5
  13. pymoo/core/survival.py +1 -1
  14. pymoo/core/variable.py +9 -9
  15. pymoo/cython/calc_perpendicular_distance.cpython-311-darwin.so +0 -0
  16. pymoo/cython/calc_perpendicular_distance.pyx +67 -0
  17. pymoo/cython/decomposition.cpython-311-darwin.so +0 -0
  18. pymoo/cython/decomposition.pyx +165 -0
  19. pymoo/cython/hv.cpython-311-darwin.so +0 -0
  20. pymoo/cython/hv.pyx +18 -0
  21. pymoo/cython/info.cpython-311-darwin.so +0 -0
  22. pymoo/cython/info.pyx +5 -0
  23. pymoo/cython/mnn.cpython-311-darwin.so +0 -0
  24. pymoo/cython/mnn.pyx +273 -0
  25. pymoo/cython/non_dominated_sorting.cpython-311-darwin.so +0 -0
  26. pymoo/cython/non_dominated_sorting.pyx +645 -0
  27. pymoo/cython/pruning_cd.cpython-311-darwin.so +0 -0
  28. pymoo/cython/pruning_cd.pyx +197 -0
  29. pymoo/cython/stochastic_ranking.cpython-311-darwin.so +0 -0
  30. pymoo/cython/stochastic_ranking.pyx +49 -0
  31. pymoo/cython/vendor/hypervolume.cpp +1621 -0
  32. pymoo/docs.py +1 -1
  33. pymoo/operators/crossover/ox.py +1 -1
  34. pymoo/operators/selection/rnd.py +2 -2
  35. pymoo/operators/selection/tournament.py +5 -5
  36. pymoo/optimize.py +2 -2
  37. pymoo/problems/dynamic/df.py +4 -4
  38. pymoo/problems/single/traveling_salesman.py +1 -1
  39. pymoo/util/misc.py +2 -2
  40. pymoo/util/mnn.py +2 -2
  41. pymoo/util/nds/fast_non_dominated_sort.py +5 -3
  42. pymoo/util/nds/non_dominated_sorting.py +2 -2
  43. pymoo/util/normalization.py +5 -8
  44. pymoo/util/ref_dirs/energy.py +4 -2
  45. pymoo/util/ref_dirs/reduction.py +1 -1
  46. pymoo/util/reference_direction.py +3 -2
  47. pymoo/util/value_functions.py +719 -0
  48. pymoo/util/vf_dominator.py +99 -0
  49. pymoo/version.py +1 -1
  50. pymoo/visualization/heatmap.py +3 -3
  51. pymoo/visualization/pcp.py +1 -1
  52. pymoo/visualization/radar.py +1 -1
  53. {pymoo-0.6.1.3.dist-info → pymoo-0.6.1.5.dev0.dist-info}/METADATA +12 -13
  54. {pymoo-0.6.1.3.dist-info → pymoo-0.6.1.5.dev0.dist-info}/RECORD +328 -316
  55. {pymoo-0.6.1.3.dist-info → pymoo-0.6.1.5.dev0.dist-info}/WHEEL +2 -1
  56. {pymoo-0.6.1.3.dist-info → pymoo-0.6.1.5.dev0.dist-info/licenses}/LICENSE +0 -0
  57. {pymoo-0.6.1.3.dist-info → pymoo-0.6.1.5.dev0.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,99 @@
1
+ import numpy as np
2
+
3
+ def get_relation(ind_a, ind_b):
4
+ return Dominator.get_relation(ind_a.F, ind_b.F, ind_a.CV[0], ind_b.CV[0])
5
+
6
+
7
+ class VFDominator:
8
+
9
+ def __init__(self, algorithm):
10
+
11
+ self.algorithm = algorithm
12
+
13
+ @staticmethod
14
+ def get_relation(a, b, cva=None, cvb=None):
15
+
16
+ if cva is not None and cvb is not None:
17
+ if cva < cvb:
18
+ return 1
19
+ elif cvb < cva:
20
+ return -1
21
+
22
+ val = 0
23
+ for i in range(len(a)):
24
+ if a[i] < b[i]:
25
+ # indifferent because once better and once worse
26
+ if val == -1:
27
+ return 0
28
+ val = 1
29
+ elif b[i] < a[i]:
30
+ # indifferent because once better and once worse
31
+ if val == 1:
32
+ return 0
33
+ val = -1
34
+ return val
35
+
36
+ @staticmethod
37
+ def calc_domination_matrix_loop(F, G):
38
+
39
+ n = F.shape[0]
40
+ CV = np.sum(G * (G > 0).astype(float), axis=1)
41
+ M = np.zeros((n, n))
42
+ for i in range(n):
43
+ for j in range(i + 1, n):
44
+ M[i, j] = Dominator.get_relation(F[i, :], F[j, :], CV[i], CV[j])
45
+ M[j, i] = -M[i, j]
46
+
47
+ return M
48
+
49
+ def calc_domination_matrix(self, F, _F=None, epsilon=0.0):
50
+
51
+ if _F is None:
52
+ _F = F
53
+
54
+ # look at the obj for dom
55
+ n = F.shape[0]
56
+ m = _F.shape[0]
57
+
58
+ L = np.repeat(F, m, axis=0)
59
+ R = np.tile(_F, (n, 1))
60
+
61
+ smaller = np.reshape(np.any(L + epsilon < R, axis=1), (n, m))
62
+ larger = np.reshape(np.any(L > R + epsilon, axis=1), (n, m))
63
+
64
+ non_dom = np.logical_and(smaller, np.logical_not(larger))
65
+ dom = np.logical_and(larger, np.logical_not(smaller))
66
+
67
+ if self.algorithm.vf_res is not None:
68
+
69
+ # Figure out what the v2 value is
70
+ v2 = self.algorithm.v2
71
+
72
+ # Get the value function
73
+ vf = self.algorithm.vf_res.vf
74
+
75
+ # How much does the DM value each solution?
76
+ F_vf = vf(F * -1)[:,np.newaxis]
77
+ _F_vf = vf(_F * -1)[:,np.newaxis]
78
+
79
+ # We want to compare each solution to the others
80
+ Lv = np.repeat(F_vf, m, axis=0)
81
+ Rv = np.tile(_F_vf, (n, 1))
82
+
83
+ # Which values are greater than (better) V2?
84
+ gtv2 = np.reshape(Lv < v2, (n, m))
85
+ # Which values are less than (worst) V2?
86
+ ltv2 = np.reshape(Rv > v2, (n, m))
87
+
88
+ # If you are greater than V2, you dominate all those who are smaller than V2
89
+ split_by_v2 = np.logical_and(gtv2, ltv2)
90
+
91
+ dom = np.logical_or(dom, split_by_v2)
92
+
93
+ M = non_dom * 1 \
94
+ + dom * -1
95
+
96
+ return M
97
+
98
+
99
+
pymoo/version.py CHANGED
@@ -1 +1 @@
1
- __version__ = "0.6.1.3"
1
+ __version__ = "0.6.1.5.dev"
@@ -32,7 +32,7 @@ class Heatmap(Plot):
32
32
  If true large values are white and small values the corresponding color. Otherwise, the other way around.
33
33
 
34
34
  solution_labels : bool or list
35
- If False no labels are plotted in the y axis. If true just the corresponding index. Otherwise the label provided.
35
+ If False no labels are plotted in the y axis. If true just the corresponding index. Otherwise, the label provided.
36
36
 
37
37
  bounds : {bounds}
38
38
 
@@ -97,11 +97,11 @@ class Heatmap(Plot):
97
97
  if self.solution_labels is None:
98
98
  pass
99
99
 
100
- # in case just true just use a number for each solution
100
+ # if true, just use a number for each solution
101
101
  elif isinstance(self.solution_labels, bool) and self.solution_labels:
102
102
  self.solution_labels = np.arange(len(F)) + 1
103
103
 
104
- # otherwise use directly the label provided
104
+ # otherwise, use directly the label provided
105
105
  else:
106
106
  if len(self.solution_labels) != len(F):
107
107
  raise Exception(
@@ -36,7 +36,7 @@ class PCP(Plot):
36
36
  Whether the value of the boundaries are shown in the plot or not.
37
37
 
38
38
  normalize_each_axis : bool
39
- Whether the values should be normalized either by bounds or implictly.
39
+ Whether the values should be normalized either by bounds or implicitly.
40
40
 
41
41
  Other Parameters
42
42
  ----------------
@@ -21,7 +21,7 @@ class Radar(Plot):
21
21
  Parameters
22
22
  ----------------
23
23
  normalize_each_objective : bool
24
- Whether each objective is normalized. Otherwise the inner and outer bound is plotted.
24
+ Whether each objective is normalized. Otherwise, the inner and outer bound is plotted.
25
25
  point_style : dict
26
26
  The style being used to visualize the points
27
27
  n_partitions : int
@@ -1,37 +1,36 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: pymoo
3
- Version: 0.6.1.3
3
+ Version: 0.6.1.5.dev0
4
4
  Summary: Multi-Objective Optimization in Python
5
- Home-page: https://pymoo.org
6
- Author: Julian Blank
7
- Author-email: blankjul@msu.edu
8
- License: Apache License 2.0
5
+ Author-email: Julian Blank <blankjul@outlook.com>
6
+ License-Expression: Apache-2.0
7
+ Project-URL: homepage, https://pymoo.org
9
8
  Keywords: optimization
10
- Platform: any
11
9
  Classifier: Intended Audience :: Developers
12
10
  Classifier: Intended Audience :: Science/Research
13
11
  Classifier: Operating System :: OS Independent
14
- Classifier: License :: OSI Approved :: Apache Software License
15
12
  Classifier: Programming Language :: Python
16
13
  Classifier: Programming Language :: Python :: 3
17
14
  Classifier: Programming Language :: Python :: 3.9
18
15
  Classifier: Programming Language :: Python :: 3.10
19
16
  Classifier: Programming Language :: Python :: 3.11
20
17
  Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
21
19
  Classifier: Topic :: Scientific/Engineering
22
20
  Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
23
21
  Classifier: Topic :: Scientific/Engineering :: Mathematics
24
22
  Requires-Python: >=3.9
25
23
  Description-Content-Type: text/x-rst
26
24
  License-File: LICENSE
27
- Requires-Dist: numpy >=1.15
28
- Requires-Dist: scipy >=1.1
29
- Requires-Dist: matplotlib >=3
30
- Requires-Dist: autograd >=1.4
31
- Requires-Dist: cma ==3.2.2
25
+ Requires-Dist: numpy>=1.19.3
26
+ Requires-Dist: scipy>=1.1
27
+ Requires-Dist: matplotlib>=3
28
+ Requires-Dist: autograd>=1.4
29
+ Requires-Dist: cma>=3.2.2
32
30
  Requires-Dist: alive-progress
33
31
  Requires-Dist: dill
34
32
  Requires-Dist: Deprecated
33
+ Dynamic: license-file
35
34
 
36
35
 
37
36