pymoo 0.6.1.6__cp312-cp312-macosx_10_13_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.
Files changed (337) hide show
  1. pymoo/__init__.py +3 -0
  2. pymoo/algorithms/__init__.py +0 -0
  3. pymoo/algorithms/base/__init__.py +0 -0
  4. pymoo/algorithms/base/bracket.py +38 -0
  5. pymoo/algorithms/base/genetic.py +110 -0
  6. pymoo/algorithms/base/line.py +62 -0
  7. pymoo/algorithms/base/local.py +39 -0
  8. pymoo/algorithms/base/meta.py +79 -0
  9. pymoo/algorithms/hyperparameters.py +91 -0
  10. pymoo/algorithms/moo/__init__.py +0 -0
  11. pymoo/algorithms/moo/age.py +310 -0
  12. pymoo/algorithms/moo/age2.py +194 -0
  13. pymoo/algorithms/moo/cmopso.py +239 -0
  14. pymoo/algorithms/moo/ctaea.py +305 -0
  15. pymoo/algorithms/moo/dnsga2.py +80 -0
  16. pymoo/algorithms/moo/kgb.py +450 -0
  17. pymoo/algorithms/moo/moead.py +183 -0
  18. pymoo/algorithms/moo/mopso_cd.py +309 -0
  19. pymoo/algorithms/moo/nsga2.py +113 -0
  20. pymoo/algorithms/moo/nsga3.py +361 -0
  21. pymoo/algorithms/moo/pinsga2.py +370 -0
  22. pymoo/algorithms/moo/rnsga2.py +188 -0
  23. pymoo/algorithms/moo/rnsga3.py +246 -0
  24. pymoo/algorithms/moo/rvea.py +214 -0
  25. pymoo/algorithms/moo/sms.py +196 -0
  26. pymoo/algorithms/moo/spea2.py +191 -0
  27. pymoo/algorithms/moo/unsga3.py +49 -0
  28. pymoo/algorithms/soo/__init__.py +0 -0
  29. pymoo/algorithms/soo/convex/__init__.py +0 -0
  30. pymoo/algorithms/soo/nonconvex/__init__.py +0 -0
  31. pymoo/algorithms/soo/nonconvex/brkga.py +162 -0
  32. pymoo/algorithms/soo/nonconvex/cmaes.py +556 -0
  33. pymoo/algorithms/soo/nonconvex/de.py +283 -0
  34. pymoo/algorithms/soo/nonconvex/direct.py +148 -0
  35. pymoo/algorithms/soo/nonconvex/es.py +213 -0
  36. pymoo/algorithms/soo/nonconvex/g3pcx.py +94 -0
  37. pymoo/algorithms/soo/nonconvex/ga.py +95 -0
  38. pymoo/algorithms/soo/nonconvex/ga_niching.py +223 -0
  39. pymoo/algorithms/soo/nonconvex/isres.py +74 -0
  40. pymoo/algorithms/soo/nonconvex/nelder.py +251 -0
  41. pymoo/algorithms/soo/nonconvex/nrbo.py +191 -0
  42. pymoo/algorithms/soo/nonconvex/optuna.py +80 -0
  43. pymoo/algorithms/soo/nonconvex/pattern.py +185 -0
  44. pymoo/algorithms/soo/nonconvex/pso.py +337 -0
  45. pymoo/algorithms/soo/nonconvex/pso_ep.py +307 -0
  46. pymoo/algorithms/soo/nonconvex/random_search.py +25 -0
  47. pymoo/algorithms/soo/nonconvex/sres.py +56 -0
  48. pymoo/algorithms/soo/univariate/__init__.py +0 -0
  49. pymoo/algorithms/soo/univariate/exp.py +46 -0
  50. pymoo/algorithms/soo/univariate/golden.py +65 -0
  51. pymoo/algorithms/soo/univariate/quadr_interp.py +81 -0
  52. pymoo/algorithms/soo/univariate/wolfe.py +163 -0
  53. pymoo/config.py +33 -0
  54. pymoo/constraints/__init__.py +3 -0
  55. pymoo/constraints/adaptive.py +66 -0
  56. pymoo/constraints/as_obj.py +56 -0
  57. pymoo/constraints/as_penalty.py +41 -0
  58. pymoo/constraints/eps.py +34 -0
  59. pymoo/constraints/from_bounds.py +36 -0
  60. pymoo/core/__init__.py +0 -0
  61. pymoo/core/algorithm.py +408 -0
  62. pymoo/core/callback.py +38 -0
  63. pymoo/core/crossover.py +79 -0
  64. pymoo/core/decision_making.py +102 -0
  65. pymoo/core/decomposition.py +76 -0
  66. pymoo/core/duplicate.py +163 -0
  67. pymoo/core/evaluator.py +116 -0
  68. pymoo/core/indicator.py +34 -0
  69. pymoo/core/individual.py +784 -0
  70. pymoo/core/infill.py +65 -0
  71. pymoo/core/initialization.py +44 -0
  72. pymoo/core/mating.py +39 -0
  73. pymoo/core/meta.py +21 -0
  74. pymoo/core/mixed.py +164 -0
  75. pymoo/core/mutation.py +44 -0
  76. pymoo/core/operator.py +46 -0
  77. pymoo/core/parameters.py +134 -0
  78. pymoo/core/plot.py +208 -0
  79. pymoo/core/population.py +180 -0
  80. pymoo/core/problem.py +373 -0
  81. pymoo/core/recorder.py +99 -0
  82. pymoo/core/repair.py +23 -0
  83. pymoo/core/replacement.py +96 -0
  84. pymoo/core/result.py +52 -0
  85. pymoo/core/sampling.py +45 -0
  86. pymoo/core/selection.py +61 -0
  87. pymoo/core/solution.py +10 -0
  88. pymoo/core/survival.py +107 -0
  89. pymoo/core/termination.py +70 -0
  90. pymoo/core/variable.py +415 -0
  91. pymoo/decomposition/__init__.py +0 -0
  92. pymoo/decomposition/aasf.py +24 -0
  93. pymoo/decomposition/asf.py +10 -0
  94. pymoo/decomposition/pbi.py +13 -0
  95. pymoo/decomposition/perp_dist.py +13 -0
  96. pymoo/decomposition/tchebicheff.py +11 -0
  97. pymoo/decomposition/util.py +13 -0
  98. pymoo/decomposition/weighted_sum.py +8 -0
  99. pymoo/docs.py +187 -0
  100. pymoo/experimental/__init__.py +0 -0
  101. pymoo/experimental/algorithms/__init__.py +0 -0
  102. pymoo/experimental/algorithms/gde3.py +57 -0
  103. pymoo/functions/__init__.py +135 -0
  104. pymoo/functions/compiled/__init__.py +0 -0
  105. pymoo/functions/compiled/calc_perpendicular_distance.cpp +27464 -0
  106. pymoo/functions/compiled/calc_perpendicular_distance.cpython-312-darwin.so +0 -0
  107. pymoo/functions/compiled/decomposition.cpp +28853 -0
  108. pymoo/functions/compiled/decomposition.cpython-312-darwin.so +0 -0
  109. pymoo/functions/compiled/info.cpp +7058 -0
  110. pymoo/functions/compiled/info.cpython-312-darwin.so +0 -0
  111. pymoo/functions/compiled/mnn.cpp +30095 -0
  112. pymoo/functions/compiled/mnn.cpython-312-darwin.so +0 -0
  113. pymoo/functions/compiled/non_dominated_sorting.cpp +35692 -0
  114. pymoo/functions/compiled/non_dominated_sorting.cpython-312-darwin.so +0 -0
  115. pymoo/functions/compiled/pruning_cd.cpp +29248 -0
  116. pymoo/functions/compiled/pruning_cd.cpython-312-darwin.so +0 -0
  117. pymoo/functions/compiled/stochastic_ranking.cpp +28042 -0
  118. pymoo/functions/compiled/stochastic_ranking.cpython-312-darwin.so +0 -0
  119. pymoo/functions/standard/__init__.py +1 -0
  120. pymoo/functions/standard/calc_perpendicular_distance.py +20 -0
  121. pymoo/functions/standard/decomposition.py +18 -0
  122. pymoo/functions/standard/hv.py +5 -0
  123. pymoo/functions/standard/mnn.py +78 -0
  124. pymoo/functions/standard/non_dominated_sorting.py +474 -0
  125. pymoo/functions/standard/pruning_cd.py +93 -0
  126. pymoo/functions/standard/stochastic_ranking.py +42 -0
  127. pymoo/gradient/__init__.py +24 -0
  128. pymoo/gradient/automatic.py +85 -0
  129. pymoo/gradient/grad_autograd.py +105 -0
  130. pymoo/gradient/grad_complex.py +35 -0
  131. pymoo/gradient/grad_jax.py +51 -0
  132. pymoo/gradient/numpy.py +22 -0
  133. pymoo/gradient/toolbox/__init__.py +19 -0
  134. pymoo/indicators/__init__.py +0 -0
  135. pymoo/indicators/distance_indicator.py +55 -0
  136. pymoo/indicators/gd.py +7 -0
  137. pymoo/indicators/gd_plus.py +7 -0
  138. pymoo/indicators/hv/__init__.py +59 -0
  139. pymoo/indicators/hv/approximate.py +105 -0
  140. pymoo/indicators/hv/exact.py +68 -0
  141. pymoo/indicators/hv/exact_2d.py +102 -0
  142. pymoo/indicators/igd.py +7 -0
  143. pymoo/indicators/igd_plus.py +7 -0
  144. pymoo/indicators/kktpm.py +151 -0
  145. pymoo/indicators/migd.py +55 -0
  146. pymoo/indicators/rmetric.py +203 -0
  147. pymoo/indicators/spacing.py +52 -0
  148. pymoo/mcdm/__init__.py +0 -0
  149. pymoo/mcdm/compromise_programming.py +19 -0
  150. pymoo/mcdm/high_tradeoff.py +40 -0
  151. pymoo/mcdm/pseudo_weights.py +32 -0
  152. pymoo/operators/__init__.py +0 -0
  153. pymoo/operators/control.py +190 -0
  154. pymoo/operators/crossover/__init__.py +0 -0
  155. pymoo/operators/crossover/binx.py +47 -0
  156. pymoo/operators/crossover/dex.py +125 -0
  157. pymoo/operators/crossover/erx.py +164 -0
  158. pymoo/operators/crossover/expx.py +53 -0
  159. pymoo/operators/crossover/hux.py +37 -0
  160. pymoo/operators/crossover/nox.py +25 -0
  161. pymoo/operators/crossover/ox.py +88 -0
  162. pymoo/operators/crossover/pcx.py +84 -0
  163. pymoo/operators/crossover/pntx.py +49 -0
  164. pymoo/operators/crossover/sbx.py +137 -0
  165. pymoo/operators/crossover/spx.py +5 -0
  166. pymoo/operators/crossover/ux.py +20 -0
  167. pymoo/operators/mutation/__init__.py +0 -0
  168. pymoo/operators/mutation/bitflip.py +17 -0
  169. pymoo/operators/mutation/gauss.py +60 -0
  170. pymoo/operators/mutation/inversion.py +42 -0
  171. pymoo/operators/mutation/nom.py +7 -0
  172. pymoo/operators/mutation/pm.py +96 -0
  173. pymoo/operators/mutation/rm.py +23 -0
  174. pymoo/operators/repair/__init__.py +0 -0
  175. pymoo/operators/repair/bounce_back.py +32 -0
  176. pymoo/operators/repair/bounds_repair.py +97 -0
  177. pymoo/operators/repair/inverse_penalty.py +91 -0
  178. pymoo/operators/repair/rounding.py +18 -0
  179. pymoo/operators/repair/to_bound.py +31 -0
  180. pymoo/operators/repair/vtype.py +11 -0
  181. pymoo/operators/sampling/__init__.py +0 -0
  182. pymoo/operators/sampling/lhs.py +76 -0
  183. pymoo/operators/sampling/rnd.py +52 -0
  184. pymoo/operators/selection/__init__.py +0 -0
  185. pymoo/operators/selection/rnd.py +75 -0
  186. pymoo/operators/selection/tournament.py +78 -0
  187. pymoo/operators/survival/__init__.py +0 -0
  188. pymoo/operators/survival/rank_and_crowding/__init__.py +1 -0
  189. pymoo/operators/survival/rank_and_crowding/classes.py +212 -0
  190. pymoo/operators/survival/rank_and_crowding/metrics.py +208 -0
  191. pymoo/optimize.py +72 -0
  192. pymoo/parallelization/__init__.py +15 -0
  193. pymoo/parallelization/dask.py +25 -0
  194. pymoo/parallelization/joblib.py +28 -0
  195. pymoo/parallelization/ray.py +31 -0
  196. pymoo/parallelization/starmap.py +24 -0
  197. pymoo/problems/__init__.py +157 -0
  198. pymoo/problems/dyn.py +47 -0
  199. pymoo/problems/dynamic/__init__.py +0 -0
  200. pymoo/problems/dynamic/cec2015.py +108 -0
  201. pymoo/problems/dynamic/df.py +451 -0
  202. pymoo/problems/dynamic/misc.py +167 -0
  203. pymoo/problems/functional.py +48 -0
  204. pymoo/problems/many/__init__.py +5 -0
  205. pymoo/problems/many/cdtlz.py +159 -0
  206. pymoo/problems/many/dcdtlz.py +88 -0
  207. pymoo/problems/many/dtlz.py +264 -0
  208. pymoo/problems/many/wfg.py +553 -0
  209. pymoo/problems/multi/__init__.py +14 -0
  210. pymoo/problems/multi/bnh.py +34 -0
  211. pymoo/problems/multi/carside.py +48 -0
  212. pymoo/problems/multi/clutch.py +104 -0
  213. pymoo/problems/multi/csi.py +55 -0
  214. pymoo/problems/multi/ctp.py +198 -0
  215. pymoo/problems/multi/dascmop.py +213 -0
  216. pymoo/problems/multi/kursawe.py +25 -0
  217. pymoo/problems/multi/modact.py +68 -0
  218. pymoo/problems/multi/mw.py +400 -0
  219. pymoo/problems/multi/omnitest.py +48 -0
  220. pymoo/problems/multi/osy.py +32 -0
  221. pymoo/problems/multi/srn.py +28 -0
  222. pymoo/problems/multi/sympart.py +94 -0
  223. pymoo/problems/multi/tnk.py +24 -0
  224. pymoo/problems/multi/truss2d.py +83 -0
  225. pymoo/problems/multi/welded_beam.py +41 -0
  226. pymoo/problems/multi/wrm.py +36 -0
  227. pymoo/problems/multi/zdt.py +151 -0
  228. pymoo/problems/multi_to_single.py +22 -0
  229. pymoo/problems/single/__init__.py +12 -0
  230. pymoo/problems/single/ackley.py +24 -0
  231. pymoo/problems/single/cantilevered_beam.py +34 -0
  232. pymoo/problems/single/flowshop_scheduling.py +113 -0
  233. pymoo/problems/single/g.py +874 -0
  234. pymoo/problems/single/griewank.py +18 -0
  235. pymoo/problems/single/himmelblau.py +15 -0
  236. pymoo/problems/single/knapsack.py +49 -0
  237. pymoo/problems/single/mopta08.py +26 -0
  238. pymoo/problems/single/multimodal.py +20 -0
  239. pymoo/problems/single/pressure_vessel.py +30 -0
  240. pymoo/problems/single/rastrigin.py +20 -0
  241. pymoo/problems/single/rosenbrock.py +22 -0
  242. pymoo/problems/single/schwefel.py +18 -0
  243. pymoo/problems/single/simple.py +13 -0
  244. pymoo/problems/single/sphere.py +19 -0
  245. pymoo/problems/single/traveling_salesman.py +79 -0
  246. pymoo/problems/single/zakharov.py +19 -0
  247. pymoo/problems/static.py +14 -0
  248. pymoo/problems/util.py +42 -0
  249. pymoo/problems/zero_to_one.py +27 -0
  250. pymoo/termination/__init__.py +23 -0
  251. pymoo/termination/collection.py +12 -0
  252. pymoo/termination/cv.py +48 -0
  253. pymoo/termination/default.py +45 -0
  254. pymoo/termination/delta.py +64 -0
  255. pymoo/termination/fmin.py +16 -0
  256. pymoo/termination/ftol.py +144 -0
  257. pymoo/termination/indicator.py +49 -0
  258. pymoo/termination/max_eval.py +14 -0
  259. pymoo/termination/max_gen.py +15 -0
  260. pymoo/termination/max_time.py +20 -0
  261. pymoo/termination/robust.py +34 -0
  262. pymoo/termination/xtol.py +33 -0
  263. pymoo/util/__init__.py +33 -0
  264. pymoo/util/archive.py +152 -0
  265. pymoo/util/cache.py +29 -0
  266. pymoo/util/clearing.py +82 -0
  267. pymoo/util/display/__init__.py +0 -0
  268. pymoo/util/display/column.py +52 -0
  269. pymoo/util/display/display.py +34 -0
  270. pymoo/util/display/multi.py +100 -0
  271. pymoo/util/display/output.py +53 -0
  272. pymoo/util/display/progress.py +54 -0
  273. pymoo/util/display/single.py +67 -0
  274. pymoo/util/dominator.py +67 -0
  275. pymoo/util/hv.py +21 -0
  276. pymoo/util/matlab_engine.py +39 -0
  277. pymoo/util/misc.py +447 -0
  278. pymoo/util/nds/__init__.py +0 -0
  279. pymoo/util/nds/dominance_degree_non_dominated_sort.py +159 -0
  280. pymoo/util/nds/efficient_non_dominated_sort.py +152 -0
  281. pymoo/util/nds/fast_non_dominated_sort.py +70 -0
  282. pymoo/util/nds/find_non_dominated.py +54 -0
  283. pymoo/util/nds/naive_non_dominated_sort.py +36 -0
  284. pymoo/util/nds/non_dominated_sorting.py +94 -0
  285. pymoo/util/nds/tree_based_non_dominated_sort.py +133 -0
  286. pymoo/util/normalization.py +312 -0
  287. pymoo/util/optimum.py +42 -0
  288. pymoo/util/randomized_argsort.py +63 -0
  289. pymoo/util/ref_dirs/__init__.py +24 -0
  290. pymoo/util/ref_dirs/construction.py +89 -0
  291. pymoo/util/ref_dirs/das_dennis.py +52 -0
  292. pymoo/util/ref_dirs/energy.py +317 -0
  293. pymoo/util/ref_dirs/energy_layer.py +119 -0
  294. pymoo/util/ref_dirs/genetic_algorithm.py +64 -0
  295. pymoo/util/ref_dirs/incremental.py +69 -0
  296. pymoo/util/ref_dirs/misc.py +128 -0
  297. pymoo/util/ref_dirs/optimizer.py +59 -0
  298. pymoo/util/ref_dirs/performance.py +162 -0
  299. pymoo/util/ref_dirs/reduction.py +85 -0
  300. pymoo/util/ref_dirs/sample_and_map.py +24 -0
  301. pymoo/util/reference_direction.py +258 -0
  302. pymoo/util/remote.py +55 -0
  303. pymoo/util/roulette.py +29 -0
  304. pymoo/util/running_metric.py +128 -0
  305. pymoo/util/sliding_window.py +25 -0
  306. pymoo/util/value_functions.py +720 -0
  307. pymoo/util/vectors.py +40 -0
  308. pymoo/util/vf_dominator.py +102 -0
  309. pymoo/vendor/__init__.py +0 -0
  310. pymoo/vendor/cec2018.py +398 -0
  311. pymoo/vendor/gta.py +617 -0
  312. pymoo/vendor/vendor_cmaes.py +421 -0
  313. pymoo/vendor/vendor_coco.py +81 -0
  314. pymoo/vendor/vendor_scipy.py +232 -0
  315. pymoo/version.py +1 -0
  316. pymoo/visualization/__init__.py +21 -0
  317. pymoo/visualization/app/__init__.py +0 -0
  318. pymoo/visualization/app/pso.py +61 -0
  319. pymoo/visualization/fitness_landscape.py +128 -0
  320. pymoo/visualization/heatmap.py +123 -0
  321. pymoo/visualization/matplotlib.py +61 -0
  322. pymoo/visualization/pcp.py +121 -0
  323. pymoo/visualization/petal.py +91 -0
  324. pymoo/visualization/radar.py +108 -0
  325. pymoo/visualization/radviz.py +68 -0
  326. pymoo/visualization/scatter.py +150 -0
  327. pymoo/visualization/star_coordinate.py +75 -0
  328. pymoo/visualization/util.py +296 -0
  329. pymoo/visualization/video/__init__.py +0 -0
  330. pymoo/visualization/video/callback_video.py +82 -0
  331. pymoo/visualization/video/one_var_one_obj.py +57 -0
  332. pymoo/visualization/video/two_var_one_obj.py +62 -0
  333. pymoo-0.6.1.6.dist-info/METADATA +209 -0
  334. pymoo-0.6.1.6.dist-info/RECORD +337 -0
  335. pymoo-0.6.1.6.dist-info/WHEEL +6 -0
  336. pymoo-0.6.1.6.dist-info/licenses/LICENSE +191 -0
  337. pymoo-0.6.1.6.dist-info/top_level.txt +1 -0
@@ -0,0 +1,553 @@
1
+ import numpy as np
2
+
3
+ from pymoo.core.problem import Problem
4
+ from pymoo.problems.many import generic_sphere, get_ref_dirs
5
+ from pymoo.functions import load_function
6
+ from pymoo.util.misc import powerset
7
+ from pymoo.util import default_random_state
8
+
9
+
10
+ class WFG(Problem):
11
+
12
+ def __init__(self, n_var, n_obj, k=None, l=None, **kwargs):
13
+ super().__init__(n_var=n_var,
14
+ n_obj=n_obj,
15
+ xl=0.0,
16
+ xu=2 * np.arange(1, n_var + 1).astype(float),
17
+ vtype=float,
18
+ **kwargs)
19
+
20
+ self.S = np.arange(2, 2 * self.n_obj + 1, 2).astype(float)
21
+ self.A = np.ones(self.n_obj - 1)
22
+
23
+ if k:
24
+ self.k = k
25
+ else:
26
+ if n_obj == 2:
27
+ self.k = 4
28
+ else:
29
+ self.k = 2 * (n_obj - 1)
30
+
31
+ if l:
32
+ self.l = l
33
+ else:
34
+ self.l = n_var - self.k
35
+
36
+ self.validate(self.l, self.k, self.n_obj)
37
+
38
+ def validate(self, l, k, n_obj):
39
+ if n_obj < 2:
40
+ raise ValueError('WFG problems must have two or more objectives.')
41
+ if not k % (n_obj - 1) == 0:
42
+ raise ValueError('Position parameter (k) must be divisible by number of objectives minus one.')
43
+ if k < 4:
44
+ raise ValueError('Position parameter (k) must be greater or equal than 4.')
45
+ if (k + l) < n_obj:
46
+ raise ValueError('Sum of distance and position parameters must be greater than num. of objs. (k + l >= M).')
47
+
48
+ def _post(self, t, a):
49
+ x = []
50
+ for i in range(t.shape[1] - 1):
51
+ x.append(np.maximum(t[:, -1], a[i]) * (t[:, i] - 0.5) + 0.5)
52
+ x.append(t[:, -1])
53
+ return np.column_stack(x)
54
+
55
+ def _calculate(self, x, s, h):
56
+ return x[:, -1][:, None] + s * np.column_stack(h)
57
+
58
+ @default_random_state
59
+ def _rand_optimal_position(self, n, random_state=None):
60
+ return random_state.random((n, self.k))
61
+
62
+ def _positional_to_optimal(self, K):
63
+ suffix = np.full((len(K), self.l), 0.35)
64
+ X = np.column_stack([K, suffix])
65
+ return X * self.xu
66
+
67
+ def _calc_pareto_set_extremes(self):
68
+ ps = np.ones((2 ** self.k, self.k))
69
+ for i, s in enumerate(powerset(np.arange(self.k))):
70
+ ps[i, s] = 0
71
+ return self._positional_to_optimal(ps)
72
+
73
+ def _calc_pareto_set_interior(self, n_points):
74
+ return self._positional_to_optimal(self._rand_optimal_position(n_points))
75
+
76
+ def _calc_pareto_set(self, n_points=500, *args, **kwargs):
77
+ extremes = self._calc_pareto_set_extremes()
78
+ interior = self._calc_pareto_set_interior(n_points - len(extremes))
79
+ return np.vstack([extremes, interior])
80
+
81
+ def _calc_pareto_front(self, ref_dirs=None, n_iterations=200, points_each_iteration=200, *args, **kwargs):
82
+ pf = self.evaluate(self._calc_pareto_set_extremes(), return_values_of=["F"])
83
+
84
+ if ref_dirs is None:
85
+ ref_dirs = get_ref_dirs(self.n_obj)
86
+
87
+ for k in range(n_iterations):
88
+ _pf = self.evaluate(self._calc_pareto_set_interior(points_each_iteration), return_values_of=["F"])
89
+ pf = np.vstack([pf, _pf])
90
+
91
+ ideal, nadir = pf.min(axis=0), pf.max(axis=0)
92
+
93
+ N = (pf - ideal) / (nadir-ideal)
94
+ dist_matrix = load_function("calc_perpendicular_distance")(N, ref_dirs)
95
+
96
+ closest = np.argmin(dist_matrix, axis=0)
97
+ pf = pf[closest]
98
+
99
+ pf = pf[np.lexsort(pf.T[::-1])]
100
+ return pf
101
+
102
+
103
+ class WFG1(WFG):
104
+
105
+ @staticmethod
106
+ def t1(x, n, k):
107
+ x[:, k:n] = _transformation_shift_linear(x[:, k:n], 0.35)
108
+ return x
109
+
110
+ @staticmethod
111
+ def t2(x, n, k):
112
+ x[:, k:n] = _transformation_bias_flat(x[:, k:n], 0.8, 0.75, 0.85)
113
+ return x
114
+
115
+ @staticmethod
116
+ def t3(x, n):
117
+ x[:, :n] = _transformation_bias_poly(x[:, :n], 0.02)
118
+ return x
119
+
120
+ @staticmethod
121
+ def t4(x, m, n, k):
122
+ w = np.arange(2, 2 * n + 1, 2)
123
+ gap = k // (m - 1)
124
+ t = []
125
+ for m in range(1, m):
126
+ _y = x[:, (m - 1) * gap: (m * gap)]
127
+ _w = w[(m - 1) * gap: (m * gap)]
128
+ t.append(_reduction_weighted_sum(_y, _w))
129
+ t.append(_reduction_weighted_sum(x[:, k:n], w[k:n]))
130
+ return np.column_stack(t)
131
+
132
+ def _evaluate(self, x, out, *args, **kwargs):
133
+ y = x / self.xu
134
+ y = WFG1.t1(y, self.n_var, self.k)
135
+ y = WFG1.t2(y, self.n_var, self.k)
136
+ y = WFG1.t3(y, self.n_var)
137
+ y = WFG1.t4(y, self.n_obj, self.n_var, self.k)
138
+
139
+ y = self._post(y, self.A)
140
+
141
+ h = [_shape_convex(y[:, :-1], m + 1) for m in range(self.n_obj - 1)]
142
+ h.append(_shape_mixed(y[:, 0], alpha=1.0, A=5.0))
143
+
144
+ out["F"] = self._calculate(y, self.S, h)
145
+
146
+ @default_random_state
147
+ def _rand_optimal_position(self, n, random_state=None):
148
+ return np.power(random_state.random((n, self.k)), 50.0)
149
+
150
+
151
+ class WFG2(WFG):
152
+
153
+ def validate(self, l, k, n_obj):
154
+ super().validate(l, k, n_obj)
155
+ validate_wfg2_wfg3(l)
156
+
157
+ @staticmethod
158
+ def t2(x, n, k):
159
+ y = [x[:, i] for i in range(k)]
160
+
161
+ l = n - k
162
+ ind_non_sep = k + l // 2
163
+
164
+ i = k + 1
165
+ while i <= ind_non_sep:
166
+ head = k + 2 * (i - k) - 2
167
+ tail = k + 2 * (i - k)
168
+ y.append(_reduction_non_sep(x[:, head:tail], 2))
169
+ i += 1
170
+
171
+ return np.column_stack(y)
172
+
173
+ @staticmethod
174
+ def t3(x, m, n, k):
175
+ ind_r_sum = k + (n - k) // 2
176
+ gap = k // (m - 1)
177
+
178
+ t = [_reduction_weighted_sum_uniform(x[:, (m - 1) * gap: (m * gap)]) for m in range(1, m)]
179
+ t.append(_reduction_weighted_sum_uniform(x[:, k:ind_r_sum]))
180
+
181
+ return np.column_stack(t)
182
+
183
+ def _evaluate(self, x, out, *args, **kwargs):
184
+ y = x / self.xu
185
+ y = WFG1.t1(y, self.n_var, self.k)
186
+ y = WFG2.t2(y, self.n_var, self.k)
187
+ y = WFG2.t3(y, self.n_obj, self.n_var, self.k)
188
+ y = self._post(y, self.A)
189
+
190
+ h = [_shape_convex(y[:, :-1], m + 1) for m in range(self.n_obj - 1)]
191
+ h.append(_shape_disconnected(y[:, 0], alpha=1.0, beta=1.0, A=5.0))
192
+
193
+ out["F"] = self._calculate(y, self.S, h)
194
+
195
+
196
+ class WFG3(WFG):
197
+
198
+ def __init__(self, n_var, n_obj, k=None, **kwargs):
199
+ super().__init__(n_var, n_obj, k=k, **kwargs)
200
+ self.A[1:] = 0
201
+
202
+ def validate(self, l, k, n_obj):
203
+ super().validate(l, k, n_obj)
204
+ validate_wfg2_wfg3(l)
205
+
206
+ def _evaluate(self, x, out, *args, **kwargs):
207
+ y = x / self.xu
208
+ y = WFG1.t1(y, self.n_var, self.k)
209
+ y = WFG2.t2(y, self.n_var, self.k)
210
+ y = WFG2.t3(y, self.n_obj, self.n_var, self.k)
211
+ y = self._post(y, self.A)
212
+
213
+ h = [_shape_linear(y[:, :-1], m + 1) for m in range(self.n_obj)]
214
+
215
+ out["F"] = self._calculate(y, self.S, h)
216
+
217
+ # def _calc_pareto_front(self, ref_dirs=None):
218
+ # if ref_dirs is None:
219
+ # ref_dirs = get_ref_dirs(self.n_obj)
220
+ # return ref_dirs * self.S
221
+
222
+
223
+ class WFG4(WFG):
224
+
225
+ @staticmethod
226
+ def t1(x):
227
+ return _transformation_shift_multi_modal(x, 30.0, 10.0, 0.35)
228
+
229
+ @staticmethod
230
+ def t2(x, m, k):
231
+ gap = k // (m - 1)
232
+ t = [_reduction_weighted_sum_uniform(x[:, (m - 1) * gap: (m * gap)]) for m in range(1, m)]
233
+ t.append(_reduction_weighted_sum_uniform(x[:, k:]))
234
+ return np.column_stack(t)
235
+
236
+ def _evaluate(self, x, out, *args, **kwargs):
237
+ y = x / self.xu
238
+ y = WFG4.t1(y)
239
+ y = WFG4.t2(y, self.n_obj, self.k)
240
+ y = self._post(y, self.A)
241
+
242
+ h = [_shape_concave(y[:, :-1], m + 1) for m in range(self.n_obj)]
243
+
244
+ out["F"] = self._calculate(y, self.S, h)
245
+
246
+ # def _calc_pareto_front(self, ref_dirs=None):
247
+ # if ref_dirs is None:
248
+ # ref_dirs = get_ref_dirs(self.n_obj)
249
+ # return generic_sphere(ref_dirs) * self.S
250
+
251
+
252
+ class WFG5(WFG):
253
+
254
+ @staticmethod
255
+ def t1(x):
256
+ return _transformation_param_deceptive(x, A=0.35, B=0.001, C=0.05)
257
+
258
+ def _evaluate(self, x, out, *args, **kwargs):
259
+ y = x / self.xu
260
+ y = WFG5.t1(y)
261
+ y = WFG4.t2(y, self.n_obj, self.k)
262
+ y = self._post(y, self.A)
263
+
264
+ h = [_shape_concave(y[:, :-1], m + 1) for m in range(self.n_obj)]
265
+
266
+ out["F"] = self._calculate(y, self.S, h)
267
+
268
+ # def _calc_pareto_front(self, ref_dirs=None):
269
+ # if ref_dirs is None:
270
+ # ref_dirs = get_ref_dirs(self.n_obj)
271
+ # return generic_sphere(ref_dirs) * self.S
272
+
273
+
274
+ class WFG6(WFG):
275
+
276
+ @staticmethod
277
+ def t2(x, m, n, k):
278
+ gap = k // (m - 1)
279
+ t = [_reduction_non_sep(x[:, (m - 1) * gap: (m * gap)], gap) for m in range(1, m)]
280
+ t.append(_reduction_non_sep(x[:, k:], n - k))
281
+ return np.column_stack(t)
282
+
283
+ def _evaluate(self, x, out, *args, **kwargs):
284
+ y = x / self.xu
285
+ y = WFG1.t1(y, self.n_var, self.k)
286
+ y = WFG6.t2(y, self.n_obj, self.n_var, self.k)
287
+ y = self._post(y, self.A)
288
+
289
+ h = [_shape_concave(y[:, :-1], m + 1) for m in range(self.n_obj)]
290
+
291
+ out["F"] = self._calculate(y, self.S, h)
292
+
293
+ # def _calc_pareto_front(self, ref_dirs=None):
294
+ # if ref_dirs is None:
295
+ # ref_dirs = get_ref_dirs(self.n_obj)
296
+ # return generic_sphere(ref_dirs) * self.S
297
+
298
+
299
+ class WFG7(WFG):
300
+
301
+ @staticmethod
302
+ def t1(x, k):
303
+ for i in range(k):
304
+ aux = _reduction_weighted_sum_uniform(x[:, i + 1:])
305
+ x[:, i] = _transformation_param_dependent(x[:, i], aux)
306
+ return x
307
+
308
+ def _evaluate(self, x, out, *args, **kwargs):
309
+ y = x / self.xu
310
+ y = WFG7.t1(y, self.k)
311
+ y = WFG1.t1(y, self.n_var, self.k)
312
+ y = WFG4.t2(y, self.n_obj, self.k)
313
+ y = self._post(y, self.A)
314
+
315
+ h = [_shape_concave(y[:, :-1], m + 1) for m in range(self.n_obj)]
316
+
317
+ out["F"] = self._calculate(y, self.S, h)
318
+
319
+ # def _calc_pareto_front(self, ref_dirs=None):
320
+ # if ref_dirs is None:
321
+ # ref_dirs = get_ref_dirs(self.n_obj)
322
+ # return generic_sphere(ref_dirs) * self.S
323
+
324
+
325
+ class WFG8(WFG):
326
+
327
+ @staticmethod
328
+ def t1(x, n, k):
329
+ ret = []
330
+ for i in range(k, n):
331
+ aux = _reduction_weighted_sum_uniform(x[:, :i])
332
+ ret.append(_transformation_param_dependent(x[:, i], aux, A=0.98 / 49.98, B=0.02, C=50.0))
333
+ return np.column_stack(ret)
334
+
335
+ def _evaluate(self, x, out, *args, **kwargs):
336
+ y = x / self.xu
337
+ y[:, self.k:self.n_var] = WFG8.t1(y, self.n_var, self.k)
338
+ y = WFG1.t1(y, self.n_var, self.k)
339
+ y = WFG4.t2(y, self.n_obj, self.k)
340
+ y = self._post(y, self.A)
341
+
342
+ h = [_shape_concave(y[:, :-1], m + 1) for m in range(self.n_obj)]
343
+
344
+ out["F"] = self._calculate(y, self.S, h)
345
+
346
+ def _positional_to_optimal(self, K):
347
+ k, l = self.k, self.l
348
+
349
+ for i in range(k, k + l):
350
+ u = K.sum(axis=1) / K.shape[1]
351
+ tmp1 = np.abs(np.floor(0.5 - u) + 0.98 / 49.98)
352
+ tmp2 = 0.02 + 49.98 * (0.98 / 49.98 - (1.0 - 2.0 * u) * tmp1)
353
+ suffix = np.power(0.35, np.power(tmp2, -1.0))
354
+
355
+ K = np.column_stack([K, suffix[:, None]])
356
+
357
+ ret = K * (2 * (np.arange(self.n_var) + 1))
358
+ return ret
359
+
360
+
361
+ class WFG9(WFG):
362
+
363
+ @staticmethod
364
+ def t1(x, n):
365
+ ret = []
366
+ for i in range(0, n - 1):
367
+ aux = _reduction_weighted_sum_uniform(x[:, i + 1:])
368
+ ret.append(_transformation_param_dependent(x[:, i], aux))
369
+ return np.column_stack(ret)
370
+
371
+ @staticmethod
372
+ def t2(x, n, k):
373
+ a = [_transformation_shift_deceptive(x[:, i], 0.35, 0.001, 0.05) for i in range(k)]
374
+ b = [_transformation_shift_multi_modal(x[:, i], 30.0, 95.0, 0.35) for i in range(k, n)]
375
+ return np.column_stack(a + b)
376
+
377
+ @staticmethod
378
+ def t3(x, m, n, k):
379
+ gap = k // (m - 1)
380
+ t = [_reduction_non_sep(x[:, (m - 1) * gap: (m * gap)], gap) for m in range(1, m)]
381
+ t.append(_reduction_non_sep(x[:, k:], n - k))
382
+ return np.column_stack(t)
383
+
384
+ def _evaluate(self, x, out, *args, **kwargs):
385
+ y = x / self.xu
386
+ y[:, :self.n_var - 1] = WFG9.t1(y, self.n_var)
387
+ y = WFG9.t2(y, self.n_var, self.k)
388
+ y = WFG9.t3(y, self.n_obj, self.n_var, self.k)
389
+
390
+ h = [_shape_concave(y[:, :-1], m + 1) for m in range(self.n_obj)]
391
+
392
+ out["F"] = self._calculate(y, self.S, h)
393
+
394
+ def _positional_to_optimal(self, K):
395
+ k, l = self.k, self.l
396
+
397
+ suffix = np.full((len(K), self.l), 0.0)
398
+ X = np.column_stack([K, suffix])
399
+ X[:, self.k + self.l - 1] = 0.35
400
+
401
+ for i in range(self.k + self.l - 2, self.k - 1, -1):
402
+ m = X[:, i + 1:k + l]
403
+ val = m.sum(axis=1) / m.shape[1]
404
+ X[:, i] = 0.35 ** ((0.02 + 1.96 * val) ** -1)
405
+
406
+ ret = X * (2 * (np.arange(self.n_var) + 1))
407
+ return ret
408
+
409
+ def _calc_pareto_front(self, ref_dirs=None):
410
+ if ref_dirs is None:
411
+ ref_dirs = get_ref_dirs(self.n_obj)
412
+ return generic_sphere(ref_dirs) * self.S
413
+
414
+
415
+ # ---------------------------------------------------------------------------------------------------------
416
+ # TRANSFORMATIONS
417
+ # ---------------------------------------------------------------------------------------------------------
418
+
419
+
420
+ def _transformation_shift_linear(value, shift=0.35):
421
+ return correct_to_01(np.fabs(value - shift) / np.fabs(np.floor(shift - value) + shift))
422
+
423
+
424
+ def _transformation_shift_deceptive(y, A=0.35, B=0.005, C=0.05):
425
+ tmp1 = np.floor(y - A + B) * (1.0 - C + (A - B) / B) / (A - B)
426
+ tmp2 = np.floor(A + B - y) * (1.0 - C + (1.0 - A - B) / B) / (1.0 - A - B)
427
+ ret = 1.0 + (np.fabs(y - A) - B) * (tmp1 + tmp2 + 1.0 / B)
428
+ return correct_to_01(ret)
429
+
430
+
431
+ def _transformation_shift_multi_modal(y, A, B, C):
432
+ tmp1 = np.fabs(y - C) / (2.0 * (np.floor(C - y) + C))
433
+ tmp2 = (4.0 * A + 2.0) * np.pi * (0.5 - tmp1)
434
+ ret = (1.0 + np.cos(tmp2) + 4.0 * B * np.power(tmp1, 2.0)) / (B + 2.0)
435
+ return correct_to_01(ret)
436
+
437
+
438
+ def _transformation_bias_flat(y, a, b, c):
439
+ ret = a + np.minimum(0, np.floor(y - b)) * (a * (b - y) / b) \
440
+ - np.minimum(0, np.floor(c - y)) * ((1.0 - a) * (y - c) / (1.0 - c))
441
+ return correct_to_01(ret)
442
+
443
+
444
+ def _transformation_bias_poly(y, alpha):
445
+ return correct_to_01(y ** alpha)
446
+
447
+
448
+ def _transformation_param_dependent(y, y_deg, A=0.98 / 49.98, B=0.02, C=50.0):
449
+ aux = A - (1.0 - 2.0 * y_deg) * np.fabs(np.floor(0.5 - y_deg) + A)
450
+ ret = np.power(y, B + (C - B) * aux)
451
+ return correct_to_01(ret)
452
+
453
+
454
+ def _transformation_param_deceptive(y, A=0.35, B=0.001, C=0.05):
455
+ tmp1 = np.floor(y - A + B) * (1.0 - C + (A - B) / B) / (A - B)
456
+ tmp2 = np.floor(A + B - y) * (1.0 - C + (1.0 - A - B) / B) / (1.0 - A - B)
457
+ ret = 1.0 + (np.fabs(y - A) - B) * (tmp1 + tmp2 + 1.0 / B)
458
+ return correct_to_01(ret)
459
+
460
+
461
+ # ---------------------------------------------------------------------------------------------------------
462
+ # REDUCTION
463
+ # ---------------------------------------------------------------------------------------------------------
464
+
465
+
466
+ def _reduction_weighted_sum(y, w):
467
+ return correct_to_01(np.dot(y, w) / w.sum())
468
+
469
+
470
+ def _reduction_weighted_sum_uniform(y):
471
+ return correct_to_01(y.mean(axis=1))
472
+
473
+
474
+ def _reduction_non_sep(y, A):
475
+ n, m = y.shape
476
+ val = np.ceil(A / 2.0)
477
+
478
+ num = np.zeros(n)
479
+ for j in range(m):
480
+ num += y[:, j]
481
+ for k in range(A - 1):
482
+ num += np.fabs(y[:, j] - y[:, (1 + j + k) % m])
483
+
484
+ denom = m * val * (1.0 + 2.0 * A - 2 * val) / A
485
+
486
+ return correct_to_01(num / denom)
487
+
488
+
489
+ # ---------------------------------------------------------------------------------------------------------
490
+ # SHAPE
491
+ # ---------------------------------------------------------------------------------------------------------
492
+
493
+
494
+ def _shape_concave(x, m):
495
+ M = x.shape[1]
496
+ if m == 1:
497
+ ret = np.prod(np.sin(0.5 * x[:, :M] * np.pi), axis=1)
498
+ elif 1 < m <= M:
499
+ ret = np.prod(np.sin(0.5 * x[:, :M - m + 1] * np.pi), axis=1)
500
+ ret *= np.cos(0.5 * x[:, M - m + 1] * np.pi)
501
+ else:
502
+ ret = np.cos(0.5 * x[:, 0] * np.pi)
503
+ return correct_to_01(ret)
504
+
505
+
506
+ def _shape_convex(x, m):
507
+ M = x.shape[1]
508
+ if m == 1:
509
+ ret = np.prod(1.0 - np.cos(0.5 * x[:, :M] * np.pi), axis=1)
510
+ elif 1 < m <= M:
511
+ ret = np.prod(1.0 - np.cos(0.5 * x[:, :M - m + 1] * np.pi), axis=1)
512
+ ret *= 1.0 - np.sin(0.5 * x[:, M - m + 1] * np.pi)
513
+ else:
514
+ ret = 1.0 - np.sin(0.5 * x[:, 0] * np.pi)
515
+ return correct_to_01(ret)
516
+
517
+
518
+ def _shape_linear(x, m):
519
+ M = x.shape[1]
520
+ if m == 1:
521
+ ret = np.prod(x, axis=1)
522
+ elif 1 < m <= M:
523
+ ret = np.prod(x[:, :M - m + 1], axis=1)
524
+ ret *= 1.0 - x[:, M - m + 1]
525
+ else:
526
+ ret = 1.0 - x[:, 0]
527
+ return correct_to_01(ret)
528
+
529
+
530
+ def _shape_mixed(x, A=5.0, alpha=1.0):
531
+ aux = 2.0 * A * np.pi
532
+ ret = np.power(1.0 - x - (np.cos(aux * x + 0.5 * np.pi) / aux), alpha)
533
+ return correct_to_01(ret)
534
+
535
+
536
+ def _shape_disconnected(x, alpha=1.0, beta=1.0, A=5.0):
537
+ aux = np.cos(A * np.pi * x ** beta)
538
+ return correct_to_01(1.0 - x ** alpha * aux ** 2)
539
+
540
+
541
+ # ---------------------------------------------------------------------------------------------------------
542
+ # UTIL
543
+ # ---------------------------------------------------------------------------------------------------------
544
+
545
+ def validate_wfg2_wfg3(l):
546
+ if not l % 2 == 0:
547
+ raise ValueError('In WFG2/WFG3 the distance-related parameter (l) must be divisible by 2.')
548
+
549
+
550
+ def correct_to_01(X, epsilon=1.0e-10):
551
+ X[np.logical_and(X < 0, X >= 0 - epsilon)] = 0
552
+ X[np.logical_and(X > 1, X <= 1 + epsilon)] = 1
553
+ return X
@@ -0,0 +1,14 @@
1
+ from pymoo.problems.multi.bnh import *
2
+ from pymoo.problems.multi.carside import *
3
+ from pymoo.problems.multi.ctp import *
4
+ from pymoo.problems.multi.dascmop import *
5
+ from pymoo.problems.multi.kursawe import *
6
+ from pymoo.problems.multi.modact import *
7
+ from pymoo.problems.multi.mw import *
8
+ from pymoo.problems.multi.osy import *
9
+ from pymoo.problems.multi.srn import *
10
+ from pymoo.problems.multi.tnk import *
11
+ from pymoo.problems.multi.truss2d import *
12
+ from pymoo.problems.multi.welded_beam import *
13
+ from pymoo.problems.multi.zdt import *
14
+
@@ -0,0 +1,34 @@
1
+ import pymoo.gradient.toolbox as anp
2
+ import numpy as np
3
+
4
+ from pymoo.core.problem import Problem
5
+
6
+
7
+ class BNH(Problem):
8
+
9
+ def __init__(self):
10
+ super().__init__(n_var=2, n_obj=2, n_ieq_constr=2, vtype=float)
11
+ self.xl = np.zeros(self.n_var)
12
+ self.xu = np.array([5.0, 3.0])
13
+
14
+ def _evaluate(self, x, out, *args, **kwargs):
15
+ f1 = 4 * x[:, 0] ** 2 + 4 * x[:, 1] ** 2
16
+ f2 = (x[:, 0] - 5) ** 2 + (x[:, 1] - 5) ** 2
17
+ g1 = (1 / 25) * ((x[:, 0] - 5) ** 2 + x[:, 1] ** 2 - 25)
18
+ g2 = -1 / 7.7 * ((x[:, 0] - 8) ** 2 + (x[:, 1] + 3) ** 2 - 7.7)
19
+
20
+ out["F"] = anp.column_stack([f1, f2])
21
+ out["G"] = anp.column_stack([g1, g2])
22
+
23
+ def _calc_pareto_front(self, n_points=100):
24
+ x1 = np.linspace(0, 5, n_points)
25
+ x2 = np.linspace(0, 5, n_points)
26
+ x2[x1 >= 3] = 3
27
+
28
+ X = np.column_stack([x1, x2])
29
+ return self.evaluate(X, return_values_of=["F"])
30
+
31
+
32
+
33
+
34
+
@@ -0,0 +1,48 @@
1
+ import pymoo.gradient.toolbox as anp
2
+ import numpy as np
3
+
4
+ from pymoo.core.problem import Problem
5
+ from pymoo.util.remote import Remote
6
+
7
+
8
+ class Carside(Problem):
9
+ def __init__(self):
10
+ super().__init__(n_var=7, n_obj=3, n_ieq_constr=10, vtype=float)
11
+ self.xl = np.array([0.5, 0.45, 0.5, 0.5, 0.875, 0.4, 0.4])
12
+ self.xu = np.array([1.5, 1.35, 1.5, 1.5, 2.625, 1.2, 1.2])
13
+
14
+ def _evaluate(self, x, out, *args, **kwargs):
15
+ g1 = 1.16 - 0.3717 * x[:,1] * x[:,3] - 0.0092928 * x[:,2]
16
+ g2 = 0.261 - 0.0159 * x[:,0] * x[:,1] - 0.188 * x[:,0] * 0.345 - 0.019 * x[:,1] * x[:,6] + 0.0144 * x[:,2] * x[:,4] + 0.08045 * x[:,5] * 0.192
17
+ g3 = 0.214 + 0.00817 * x[:,4] - 0.131 * x[:,0] * 0.345 - 0.0704 * x[:,0] * 0.192 + 0.03099 * x[:,1] * x[:,5] - 0.018 * x[:,1] * x[:,6] + 0.0208 * x[:,2] * 0.345 + 0.121 * x[:,2] * 0.192 - 0.00364 * x[:,4] * x[:,5] - 0.018 * x[:,1] ** 2
18
+ g4 = 0.74 - 0.61 * x[:,1] - 0.031296 * x[:,2] - 0.166 * x[:,6] * 0.192 + 0.227 * x[:,1] ** 2
19
+ g5 = 28.98 + 3.818 * x[:,2] - 4.2 * x[:,0] * x[:,1] + 6.63 * x[:,5] * 0.192 - 7.77 * x[:,6] * 0.345
20
+ g6 = 33.86 + 2.95 * x[:,2] - 5.057 * x[:,0] * x[:,1] - 11 * x[:,1] * 0.345 - 9.98 * x[:,6] * 0.345 + 22 * 0.345 * 0.192
21
+ g7 = 46.36 - 9.9 * x[:,1] - 12.9 * x[:,0] * 0.345
22
+ g8 = 4.72 - 0.5 * x[:,3] - 0.19 * x[:,1] * x[:,2]
23
+ g9 = 10.58 - 0.674 * x[:,0] * x[:,1] - 1.95 * x[:,1] * 0.345
24
+ g10 = 16.45 - 0.489 * x[:,2] * x[:,6] - 0.843 * x[:,4] * x[:,5]
25
+
26
+ f1 = 1.98 + 4.9 * x[:,0] + 6.67 * x[:,1] + 6.98 * x[:,2] + 4.01 * x[:,3] + 1.78 * x[:,4] + 0.00001 * x[:,5] + 2.73 * x[:,6]
27
+ f2 = g8
28
+ f3 = (g9 + g10) / 2.0
29
+
30
+ g1 = - 1 + g1 / 1.0
31
+ g2 = -1 + g2 / 0.32
32
+ g3 = -1 + g3 / 0.32
33
+ g4 = -1 + g4 / 0.32
34
+ g5 = -1 + g5 / 32.0
35
+ g6 = -1 + g6 / 32.0
36
+ g7 = -1 + g7 / 32.0
37
+ g8 = -1 + g8 / 4.0
38
+ g9 = -1 + g9 / 9.9
39
+ g10 = -1 + g10 / 15.7
40
+
41
+ out["F"] = anp.column_stack([f1, f2, f3])
42
+ out["G"] = anp.column_stack([g1, g2, g3, g4, g5, g6, g7, g8, g9, g10])
43
+
44
+ def _calc_pareto_front(self, *args, **kwargs):
45
+ return Remote.get_instance().load("pymoo", "pf", "carside.pf")
46
+
47
+
48
+