desdeo 1.2__py3-none-any.whl → 2.1.0__py3-none-any.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 (182) hide show
  1. desdeo/__init__.py +8 -8
  2. desdeo/adm/ADMAfsar.py +551 -0
  3. desdeo/adm/ADMChen.py +414 -0
  4. desdeo/adm/BaseADM.py +119 -0
  5. desdeo/adm/__init__.py +11 -0
  6. desdeo/api/README.md +73 -0
  7. desdeo/api/__init__.py +15 -0
  8. desdeo/api/app.py +50 -0
  9. desdeo/api/config.py +90 -0
  10. desdeo/api/config.toml +64 -0
  11. desdeo/api/db.py +27 -0
  12. desdeo/api/db_init.py +85 -0
  13. desdeo/api/db_models.py +164 -0
  14. desdeo/api/malaga_db_init.py +27 -0
  15. desdeo/api/models/__init__.py +266 -0
  16. desdeo/api/models/archive.py +23 -0
  17. desdeo/api/models/emo.py +128 -0
  18. desdeo/api/models/enautilus.py +69 -0
  19. desdeo/api/models/gdm/gdm_aggregate.py +139 -0
  20. desdeo/api/models/gdm/gdm_base.py +69 -0
  21. desdeo/api/models/gdm/gdm_score_bands.py +114 -0
  22. desdeo/api/models/gdm/gnimbus.py +138 -0
  23. desdeo/api/models/generic.py +104 -0
  24. desdeo/api/models/generic_states.py +401 -0
  25. desdeo/api/models/nimbus.py +158 -0
  26. desdeo/api/models/preference.py +128 -0
  27. desdeo/api/models/problem.py +717 -0
  28. desdeo/api/models/reference_point_method.py +18 -0
  29. desdeo/api/models/session.py +49 -0
  30. desdeo/api/models/state.py +463 -0
  31. desdeo/api/models/user.py +52 -0
  32. desdeo/api/models/utopia.py +25 -0
  33. desdeo/api/routers/_EMO.backup +309 -0
  34. desdeo/api/routers/_NAUTILUS.py +245 -0
  35. desdeo/api/routers/_NAUTILUS_navigator.py +233 -0
  36. desdeo/api/routers/_NIMBUS.py +765 -0
  37. desdeo/api/routers/__init__.py +5 -0
  38. desdeo/api/routers/emo.py +497 -0
  39. desdeo/api/routers/enautilus.py +237 -0
  40. desdeo/api/routers/gdm/gdm_aggregate.py +234 -0
  41. desdeo/api/routers/gdm/gdm_base.py +420 -0
  42. desdeo/api/routers/gdm/gdm_score_bands/gdm_score_bands_manager.py +398 -0
  43. desdeo/api/routers/gdm/gdm_score_bands/gdm_score_bands_routers.py +377 -0
  44. desdeo/api/routers/gdm/gnimbus/gnimbus_manager.py +698 -0
  45. desdeo/api/routers/gdm/gnimbus/gnimbus_routers.py +591 -0
  46. desdeo/api/routers/generic.py +233 -0
  47. desdeo/api/routers/nimbus.py +705 -0
  48. desdeo/api/routers/problem.py +307 -0
  49. desdeo/api/routers/reference_point_method.py +93 -0
  50. desdeo/api/routers/session.py +100 -0
  51. desdeo/api/routers/test.py +16 -0
  52. desdeo/api/routers/user_authentication.py +520 -0
  53. desdeo/api/routers/utils.py +187 -0
  54. desdeo/api/routers/utopia.py +230 -0
  55. desdeo/api/schema.py +100 -0
  56. desdeo/api/tests/__init__.py +0 -0
  57. desdeo/api/tests/conftest.py +151 -0
  58. desdeo/api/tests/test_enautilus.py +330 -0
  59. desdeo/api/tests/test_models.py +1179 -0
  60. desdeo/api/tests/test_routes.py +1075 -0
  61. desdeo/api/utils/_database.py +263 -0
  62. desdeo/api/utils/_logger.py +29 -0
  63. desdeo/api/utils/database.py +36 -0
  64. desdeo/api/utils/emo_database.py +40 -0
  65. desdeo/core.py +34 -0
  66. desdeo/emo/__init__.py +159 -0
  67. desdeo/emo/hooks/archivers.py +188 -0
  68. desdeo/emo/methods/EAs.py +541 -0
  69. desdeo/emo/methods/__init__.py +0 -0
  70. desdeo/emo/methods/bases.py +12 -0
  71. desdeo/emo/methods/templates.py +111 -0
  72. desdeo/emo/operators/__init__.py +1 -0
  73. desdeo/emo/operators/crossover.py +1282 -0
  74. desdeo/emo/operators/evaluator.py +114 -0
  75. desdeo/emo/operators/generator.py +459 -0
  76. desdeo/emo/operators/mutation.py +1224 -0
  77. desdeo/emo/operators/scalar_selection.py +202 -0
  78. desdeo/emo/operators/selection.py +1778 -0
  79. desdeo/emo/operators/termination.py +286 -0
  80. desdeo/emo/options/__init__.py +108 -0
  81. desdeo/emo/options/algorithms.py +435 -0
  82. desdeo/emo/options/crossover.py +164 -0
  83. desdeo/emo/options/generator.py +131 -0
  84. desdeo/emo/options/mutation.py +260 -0
  85. desdeo/emo/options/repair.py +61 -0
  86. desdeo/emo/options/scalar_selection.py +66 -0
  87. desdeo/emo/options/selection.py +127 -0
  88. desdeo/emo/options/templates.py +383 -0
  89. desdeo/emo/options/termination.py +143 -0
  90. desdeo/explanations/__init__.py +6 -0
  91. desdeo/explanations/explainer.py +100 -0
  92. desdeo/explanations/utils.py +90 -0
  93. desdeo/gdm/__init__.py +22 -0
  94. desdeo/gdm/gdmtools.py +45 -0
  95. desdeo/gdm/score_bands.py +114 -0
  96. desdeo/gdm/voting_rules.py +50 -0
  97. desdeo/mcdm/__init__.py +41 -0
  98. desdeo/mcdm/enautilus.py +338 -0
  99. desdeo/mcdm/gnimbus.py +484 -0
  100. desdeo/mcdm/nautili.py +345 -0
  101. desdeo/mcdm/nautilus.py +477 -0
  102. desdeo/mcdm/nautilus_navigator.py +656 -0
  103. desdeo/mcdm/nimbus.py +417 -0
  104. desdeo/mcdm/pareto_navigator.py +269 -0
  105. desdeo/mcdm/reference_point_method.py +186 -0
  106. desdeo/problem/__init__.py +83 -0
  107. desdeo/problem/evaluator.py +561 -0
  108. desdeo/problem/external/__init__.py +18 -0
  109. desdeo/problem/external/core.py +356 -0
  110. desdeo/problem/external/pymoo_provider.py +266 -0
  111. desdeo/problem/external/runtime.py +44 -0
  112. desdeo/problem/gurobipy_evaluator.py +562 -0
  113. desdeo/problem/infix_parser.py +341 -0
  114. desdeo/problem/json_parser.py +944 -0
  115. desdeo/problem/pyomo_evaluator.py +487 -0
  116. desdeo/problem/schema.py +1829 -0
  117. desdeo/problem/simulator_evaluator.py +348 -0
  118. desdeo/problem/sympy_evaluator.py +244 -0
  119. desdeo/problem/testproblems/__init__.py +88 -0
  120. desdeo/problem/testproblems/benchmarks_server.py +120 -0
  121. desdeo/problem/testproblems/binh_and_korn_problem.py +88 -0
  122. desdeo/problem/testproblems/cake_problem.py +185 -0
  123. desdeo/problem/testproblems/dmitry_forest_problem_discrete.py +71 -0
  124. desdeo/problem/testproblems/dtlz2_problem.py +102 -0
  125. desdeo/problem/testproblems/forest_problem.py +283 -0
  126. desdeo/problem/testproblems/knapsack_problem.py +163 -0
  127. desdeo/problem/testproblems/mcwb_problem.py +831 -0
  128. desdeo/problem/testproblems/mixed_variable_dimenrions_problem.py +83 -0
  129. desdeo/problem/testproblems/momip_problem.py +172 -0
  130. desdeo/problem/testproblems/multi_valued_constraints.py +119 -0
  131. desdeo/problem/testproblems/nimbus_problem.py +143 -0
  132. desdeo/problem/testproblems/pareto_navigator_problem.py +89 -0
  133. desdeo/problem/testproblems/re_problem.py +492 -0
  134. desdeo/problem/testproblems/river_pollution_problems.py +440 -0
  135. desdeo/problem/testproblems/rocket_injector_design_problem.py +140 -0
  136. desdeo/problem/testproblems/simple_problem.py +351 -0
  137. desdeo/problem/testproblems/simulator_problem.py +92 -0
  138. desdeo/problem/testproblems/single_objective.py +289 -0
  139. desdeo/problem/testproblems/spanish_sustainability_problem.py +945 -0
  140. desdeo/problem/testproblems/zdt_problem.py +274 -0
  141. desdeo/problem/utils.py +245 -0
  142. desdeo/tools/GenerateReferencePoints.py +181 -0
  143. desdeo/tools/__init__.py +120 -0
  144. desdeo/tools/desc_gen.py +22 -0
  145. desdeo/tools/generics.py +165 -0
  146. desdeo/tools/group_scalarization.py +3090 -0
  147. desdeo/tools/gurobipy_solver_interfaces.py +258 -0
  148. desdeo/tools/indicators_binary.py +117 -0
  149. desdeo/tools/indicators_unary.py +362 -0
  150. desdeo/tools/interaction_schema.py +38 -0
  151. desdeo/tools/intersection.py +54 -0
  152. desdeo/tools/iterative_pareto_representer.py +99 -0
  153. desdeo/tools/message.py +265 -0
  154. desdeo/tools/ng_solver_interfaces.py +199 -0
  155. desdeo/tools/non_dominated_sorting.py +134 -0
  156. desdeo/tools/patterns.py +283 -0
  157. desdeo/tools/proximal_solver.py +99 -0
  158. desdeo/tools/pyomo_solver_interfaces.py +477 -0
  159. desdeo/tools/reference_vectors.py +229 -0
  160. desdeo/tools/scalarization.py +2065 -0
  161. desdeo/tools/scipy_solver_interfaces.py +454 -0
  162. desdeo/tools/score_bands.py +627 -0
  163. desdeo/tools/utils.py +388 -0
  164. desdeo/tools/visualizations.py +67 -0
  165. desdeo/utopia_stuff/__init__.py +0 -0
  166. desdeo/utopia_stuff/data/1.json +15 -0
  167. desdeo/utopia_stuff/data/2.json +13 -0
  168. desdeo/utopia_stuff/data/3.json +15 -0
  169. desdeo/utopia_stuff/data/4.json +17 -0
  170. desdeo/utopia_stuff/data/5.json +15 -0
  171. desdeo/utopia_stuff/from_json.py +40 -0
  172. desdeo/utopia_stuff/reinit_user.py +38 -0
  173. desdeo/utopia_stuff/utopia_db_init.py +212 -0
  174. desdeo/utopia_stuff/utopia_problem.py +403 -0
  175. desdeo/utopia_stuff/utopia_problem_old.py +415 -0
  176. desdeo/utopia_stuff/utopia_reference_solutions.py +79 -0
  177. desdeo-2.1.0.dist-info/METADATA +186 -0
  178. desdeo-2.1.0.dist-info/RECORD +180 -0
  179. {desdeo-1.2.dist-info → desdeo-2.1.0.dist-info}/WHEEL +1 -1
  180. desdeo-2.1.0.dist-info/licenses/LICENSE +21 -0
  181. desdeo-1.2.dist-info/METADATA +0 -16
  182. desdeo-1.2.dist-info/RECORD +0 -4
@@ -0,0 +1,492 @@
1
+ import numpy as np
2
+
3
+ from desdeo.problem.schema import (
4
+ Constraint,
5
+ ConstraintTypeEnum,
6
+ Objective,
7
+ ObjectiveTypeEnum,
8
+ Problem,
9
+ Variable,
10
+ VariableTypeEnum,
11
+ )
12
+
13
+
14
+ def re21(f: float = 10.0, sigma: float = 10.0, e: float = 2.0 * 1e5, l: float = 200.0) -> Problem:
15
+ r"""Defines the four bar truss design problem.
16
+
17
+ The objective functions and constraints for the four bar truss design problem are defined as follows:
18
+
19
+ \begin{align}
20
+ &\min_{\mathbf{x}} & f_1(\mathbf{x}) & = L(2x_1 + \sqrt{2}x_2 + \sqrt{x_3} + x_4) \\
21
+ &\min_{\mathbf{x}} & f_2(\mathbf{x}) & = \frac{FL}{E}\left(\frac{2}{x_1} + \frac{2\sqrt{2}}{x_2}
22
+ - \frac{2\sqrt{2}}{x_3} + \frac{2}{x_4}\right) \\
23
+ \end{align}
24
+
25
+ where $x_1, x_4 \in [a, 3a]$, $x_2, x_3 \in [\sqrt{2}a, 3a]$, and $a = F/\sigma$.
26
+ The parameters are defined as $F = 10$ $kN$, $E = 2e^5$ $kN/cm^2$, $L = 200$ $cm$, and $\sigma = 10$ $kN/cm^2$.
27
+
28
+ References:
29
+ Cheng, F. Y., & Li, X. S. (1999). Generalized center method for multiobjective engineering optimization.
30
+ Engineering Optimization, 31(5), 641-661.
31
+
32
+ Tanabe, R. & Ishibuchi, H. (2020). An easy-to-use real-world multi-objective
33
+ optimization problem suite. Applied soft computing, 89, 106078.
34
+ https://doi.org/10.1016/j.asoc.2020.106078.
35
+
36
+ https://github.com/ryojitanabe/reproblems/blob/master/reproblem_python_ver/reproblem.py
37
+
38
+ Args:
39
+ f (float, optional): Force (kN). Defaults to 10.0.
40
+ sigma (float. optional): Stress (kN/cm^2). Defaults to 10.0.
41
+ e (float, optional): Young modulus? (kN/cm^2). Defaults to 2.0 * 1e5.
42
+ l (float, optional): Length (cm). Defaults to 200.0.
43
+
44
+ Returns:
45
+ Problem: an instance of the four bar truss design problem.
46
+ """
47
+ a = f / sigma
48
+
49
+ x_1 = Variable(
50
+ name="x_1",
51
+ symbol="x_1",
52
+ variable_type=VariableTypeEnum.real,
53
+ lowerbound=a,
54
+ upperbound=3 * a,
55
+ initial_value=2 * a,
56
+ )
57
+ x_2 = Variable(
58
+ name="x_2",
59
+ symbol="x_2",
60
+ variable_type=VariableTypeEnum.real,
61
+ lowerbound=np.sqrt(2.0) * a,
62
+ upperbound=3 * a,
63
+ initial_value=2 * a,
64
+ )
65
+ x_3 = Variable(
66
+ name="x_3",
67
+ symbol="x_3",
68
+ variable_type=VariableTypeEnum.real,
69
+ lowerbound=np.sqrt(2.0) * a,
70
+ upperbound=3 * a,
71
+ initial_value=2 * a,
72
+ )
73
+ x_4 = Variable(
74
+ name="x_4",
75
+ symbol="x_4",
76
+ variable_type=VariableTypeEnum.real,
77
+ lowerbound=a,
78
+ upperbound=3 * a,
79
+ initial_value=2 * a,
80
+ )
81
+
82
+ f_1 = Objective(
83
+ name="f_1",
84
+ symbol="f_1",
85
+ func=f"{l} * ((2 * x_1) + {np.sqrt(2.0)} * x_2 + Sqrt(x_3) + x_4)",
86
+ objective_type=ObjectiveTypeEnum.analytical,
87
+ is_linear=False,
88
+ is_convex=False, # Not checked
89
+ is_twice_differentiable=True,
90
+ )
91
+ f_2 = Objective(
92
+ name="f_2",
93
+ symbol="f_2",
94
+ func=f"({(f * l) / e} * ((2.0 / x_1) + (2.0 * {np.sqrt(2.0)} / x_2) - "
95
+ f"(2.0 * {np.sqrt(2.0)} / x_3) + (2.0 / x_4)))",
96
+ objective_type=ObjectiveTypeEnum.analytical,
97
+ is_linear=False,
98
+ is_convex=False, # Not checked
99
+ is_twice_differentiable=True,
100
+ )
101
+
102
+ return Problem(
103
+ name="RE21",
104
+ description="the four bar truss design problem",
105
+ variables=[x_1, x_2, x_3, x_4],
106
+ objectives=[f_1, f_2],
107
+ )
108
+
109
+
110
+ def re22() -> Problem:
111
+ r"""The reinforced concrete beam design problem.
112
+
113
+ The objective functions and constraints for the reinforced concrete beam design problem are defined as follows:
114
+
115
+ \begin{align}
116
+ &\min_{\mathbf{x}} & f_1(\mathbf{x}) & = 29.4x_1 + 0.6x_2x_3 \\
117
+ &\min_{\mathbf{x}} & f_2(\mathbf{x}) & = \sum_{i=1}^2 \max\{g_i(\mathbf{x}), 0\} \\
118
+ &\text{s.t.,} & g_1(\mathbf{x}) & = x_1x_3 - 7.735\frac{x_1^2}{x_2} - 180 \geq 0,\\
119
+ & & g_2(\mathbf{x}) & = 4 - \frac{x_3}{x_2} \geq 0.
120
+ \end{align}
121
+
122
+ where $x_2 \in [0, 20]$ and $x_3 \in [0, 40]$.
123
+
124
+ References:
125
+ Amir, H. M., & Hasegawa, T. (1989). Nonlinear mixed-discrete structural optimization.
126
+ Journal of Structural Engineering, 115(3), 626-646.
127
+
128
+ Tanabe, R. & Ishibuchi, H. (2020). An easy-to-use real-world multi-objective
129
+ optimization problem suite. Applied soft computing, 89, 106078.
130
+ https://doi.org/10.1016/j.asoc.2020.106078.
131
+
132
+ https://github.com/ryojitanabe/reproblems/blob/master/reproblem_python_ver/reproblem.py
133
+
134
+ Returns:
135
+ Problem: an instance of the reinforced concrete beam design problem.
136
+ """
137
+ x_2 = Variable(
138
+ name="x_2", symbol="x_2", variable_type=VariableTypeEnum.real, lowerbound=0, upperbound=20, initial_value=10
139
+ )
140
+ x_3 = Variable(
141
+ name="x_3", symbol="x_3", variable_type=VariableTypeEnum.real, lowerbound=0, upperbound=40, initial_value=20
142
+ )
143
+
144
+ # x_1 pre-defined discrete values
145
+ feasible_values = np.array(
146
+ [
147
+ 0.20,
148
+ 0.31,
149
+ 0.40,
150
+ 0.44,
151
+ 0.60,
152
+ 0.62,
153
+ 0.79,
154
+ 0.80,
155
+ 0.88,
156
+ 0.93,
157
+ 1.0,
158
+ 1.20,
159
+ 1.24,
160
+ 1.32,
161
+ 1.40,
162
+ 1.55,
163
+ 1.58,
164
+ 1.60,
165
+ 1.76,
166
+ 1.80,
167
+ 1.86,
168
+ 2.0,
169
+ 2.17,
170
+ 2.20,
171
+ 2.37,
172
+ 2.40,
173
+ 2.48,
174
+ 2.60,
175
+ 2.64,
176
+ 2.79,
177
+ 2.80,
178
+ 3.0,
179
+ 3.08,
180
+ 3.10,
181
+ 3.16,
182
+ 3.41,
183
+ 3.52,
184
+ 3.60,
185
+ 3.72,
186
+ 3.95,
187
+ 3.96,
188
+ 4.0,
189
+ 4.03,
190
+ 4.20,
191
+ 4.34,
192
+ 4.40,
193
+ 4.65,
194
+ 4.74,
195
+ 4.80,
196
+ 4.84,
197
+ 5.0,
198
+ 5.28,
199
+ 5.40,
200
+ 5.53,
201
+ 5.72,
202
+ 6.0,
203
+ 6.16,
204
+ 6.32,
205
+ 6.60,
206
+ 7.11,
207
+ 7.20,
208
+ 7.80,
209
+ 7.90,
210
+ 8.0,
211
+ 8.40,
212
+ 8.69,
213
+ 9.0,
214
+ 9.48,
215
+ 10.27,
216
+ 11.0,
217
+ 11.06,
218
+ 11.85,
219
+ 12.0,
220
+ 13.0,
221
+ 14.0,
222
+ 15.0,
223
+ ]
224
+ )
225
+
226
+ variables = [x_2, x_3]
227
+
228
+ # forming a set of variables and a constraint to make sure x_1 is from the set of feasible values
229
+ x_1_eprs = []
230
+ for i in range(len(feasible_values)):
231
+ x = Variable(
232
+ name=f"x_1_{i}", symbol=f"x_1_{i}", variable_type=VariableTypeEnum.binary, lowerbound=0, upperbound=1
233
+ )
234
+ variables.append(x)
235
+ expr = f"x_1_{i} * {feasible_values[i]}"
236
+ x_1_eprs.append(expr)
237
+ x_1_eprs = " + ".join(x_1_eprs)
238
+
239
+ sum_expr = [f"x_1_{i}" for i in range(len(feasible_values))]
240
+ sum_expr = " + ".join(sum_expr) + " - 1"
241
+
242
+ x_1_con = Constraint(
243
+ name="x_1_con", symbol="x_1_con", cons_type=ConstraintTypeEnum.EQ, func=sum_expr, is_linear=True
244
+ )
245
+
246
+ g_1 = Constraint(
247
+ name="g_1",
248
+ symbol="g_1",
249
+ cons_type=ConstraintTypeEnum.LTE,
250
+ func=f"- (({x_1_eprs}) * x_3 - 7.735 * (({x_1_eprs})**2 / x_2) - 180)",
251
+ is_linear=False,
252
+ is_convex=False, # Not checked
253
+ is_twice_differentiable=True,
254
+ )
255
+ g_2 = Constraint(
256
+ name="g_2",
257
+ symbol="g_2",
258
+ cons_type=ConstraintTypeEnum.LTE,
259
+ func="-(4 - x_3 / x_2)",
260
+ is_linear=False,
261
+ is_convex=False, # Not checked
262
+ is_twice_differentiable=True,
263
+ )
264
+
265
+ f_1 = Objective(
266
+ name="f_1",
267
+ symbol="f_1",
268
+ func=f"29.4 * ({x_1_eprs}) + 0.6 * x_2 * x_3",
269
+ objective_type=ObjectiveTypeEnum.analytical,
270
+ is_linear=False,
271
+ is_convex=False, # Not checked
272
+ is_twice_differentiable=True,
273
+ )
274
+ f_2 = Objective(
275
+ name="f_2",
276
+ symbol="f_2",
277
+ func=f"Max(({x_1_eprs}) * x_3 - 7.735 * (({x_1_eprs})**2 / x_2) - 180, 0) + Max(4 - x_3 / x_2, 0)",
278
+ objective_type=ObjectiveTypeEnum.analytical,
279
+ is_linear=False,
280
+ is_convex=False, # Not checked
281
+ is_twice_differentiable=False,
282
+ )
283
+ return Problem(
284
+ name="re22",
285
+ description="The reinforced concrete beam design problem",
286
+ variables=variables,
287
+ objectives=[f_1, f_2],
288
+ constraints=[g_1, g_2, x_1_con],
289
+ )
290
+
291
+
292
+ def re23() -> Problem:
293
+ r"""The pressure vessel design problem.
294
+
295
+ The objective functions and constraints for the pressure vessel design problem are defined as follows:
296
+
297
+ \begin{align}
298
+ &\min_{\mathbf{x}} & f_1(\mathbf{x}) & = 0.6224x_1x_3x_4 + 1.7781x_2x_3^2 + 3.1661x_1^2x_4 + 19.84x_1^2x_3 \\
299
+ &\min_{\mathbf{x}} & f_2(\mathbf{x}) & = \sum_{i=1}^3 \max\{g_i(\mathbf{x}), 0\} \\
300
+ &\text{s.t.,} & g_1(\mathbf{x}) & = -x_1 + 0.0193x_3 \leq 0,\\
301
+ & & g_2(\mathbf{x}) & = -x_2 + 0.00954x_3 \leq 0, \\
302
+ & & g_3(\mathbf{x}) & = -\pi x_3^2x_4 - \frac{4}{3}\pi x_3^3 + 1\,296\,000 \leq 0.
303
+ \end{align}
304
+
305
+ where $x_1, x_2 \in \{1,\dots,100\}$, $x_3 \in [10, 200]$, and $x_4 \in [10, 240]$. $x_1$ and $x_2$ are
306
+ integer multiples of 0.0625. $x_1$, $x_2$, $x_3$, and $x_4$ represent the thicknesses of
307
+ the shell, the head of a pressure vessel, the inner radius, and the length of
308
+ the cylindrical section, respectively. We determined the ranges of $x_2$ and $x_3$
309
+ according to [S.3].
310
+
311
+ References:
312
+ Kannan, B. K., & Kramer, S. N. (1994). An augmented Lagrange multiplier based method
313
+ for mixed integer discrete continuous optimization and its applications to mechanical design.
314
+
315
+ Tanabe, R. & Ishibuchi, H. (2020). An easy-to-use real-world multi-objective
316
+ optimization problem suite. Applied soft computing, 89, 106078.
317
+ https://doi.org/10.1016/j.asoc.2020.106078.
318
+
319
+ https://github.com/ryojitanabe/reproblems/blob/master/reproblem_python_ver/reproblem.py
320
+
321
+ Returns:
322
+ Problem: an instance of the pressure vessel design problem.
323
+ """
324
+ x_1 = Variable(name="x_1", symbol="x_1", variable_type=VariableTypeEnum.integer, lowerbound=1, upperbound=100)
325
+ x_2 = Variable(name="x_2", symbol="x_2", variable_type=VariableTypeEnum.integer, lowerbound=1, upperbound=100)
326
+ x_3 = Variable(name="x_3", symbol="x_3", variable_type=VariableTypeEnum.real, lowerbound=10, upperbound=200)
327
+ x_4 = Variable(name="x_4", symbol="x_4", variable_type=VariableTypeEnum.real, lowerbound=10, upperbound=240)
328
+
329
+ # variables x_1 and x_2 are integer multiples of 0.0625
330
+ x_1_exprs = "(0.0625 * x_1)"
331
+ x_2_exprs = "(0.0625 * x_2)"
332
+
333
+ g_1 = Constraint(
334
+ name="g_1",
335
+ symbol="g_1",
336
+ cons_type=ConstraintTypeEnum.LTE,
337
+ func=f"-({x_1_exprs} - 0.0193 * x_3)",
338
+ is_linear=True,
339
+ is_convex=False, # Not checked
340
+ is_twice_differentiable=True,
341
+ )
342
+ g_2 = Constraint(
343
+ name="g_2",
344
+ symbol="g_2",
345
+ cons_type=ConstraintTypeEnum.LTE,
346
+ func=f"-({x_2_exprs} - 0.00954 * x_3)",
347
+ is_linear=True,
348
+ is_convex=False, # Not checked
349
+ is_twice_differentiable=True,
350
+ )
351
+ g_3 = Constraint(
352
+ name="g_3",
353
+ symbol="g_3",
354
+ cons_type=ConstraintTypeEnum.LTE,
355
+ func=f"-({np.pi} * x_3**2 * x_4 + (4/3) * {np.pi} * x_3**3 - 1296000)",
356
+ is_linear=False,
357
+ is_convex=False, # Not checked
358
+ is_twice_differentiable=True,
359
+ )
360
+
361
+ f_1 = Objective(
362
+ name="f_1",
363
+ symbol="f_1",
364
+ func=f"0.6224 * {x_1_exprs} * x_3 * x_4 + (1.7781 * {x_2_exprs} * x_3**2) + "
365
+ f"(3.1661 * {x_1_exprs}**2 * x_4) + (19.84 * {x_1_exprs}**2 * x_3)",
366
+ objective_type=ObjectiveTypeEnum.analytical,
367
+ is_linear=False,
368
+ is_convex=False, # Not checked
369
+ is_twice_differentiable=True,
370
+ )
371
+ f_2 = Objective(
372
+ name="f_2",
373
+ symbol="f_2",
374
+ func=f"Max({x_1_exprs} - 0.0193 * x_3, 0) + Max({x_2_exprs} - 0.00954 * x_3, 0) + "
375
+ f"Max({np.pi} * x_3**2 * x_4 + (4/3) * {np.pi} * x_3**3 - 1296000, 0)",
376
+ objective_type=ObjectiveTypeEnum.analytical,
377
+ is_linear=False,
378
+ is_convex=False, # Not checked
379
+ is_twice_differentiable=False,
380
+ )
381
+ return Problem(
382
+ name="re23",
383
+ description="The pressure vessel design problem",
384
+ variables=[x_1, x_2, x_3, x_4],
385
+ objectives=[f_1, f_2],
386
+ constraints=[g_1, g_2, g_3],
387
+ )
388
+
389
+
390
+ def re24() -> Problem:
391
+ r"""The hatch cover design problem.
392
+
393
+ The objective functions and constraints for the hatch cover design problem are defined as follows:
394
+
395
+ \begin{align}
396
+ &\min_{\mathbf{x}} & f_1(\mathbf{x}) & = x_1 + 120x_2 \\
397
+ &\min_{\mathbf{x}} & f_2(\mathbf{x}) & = \sum_{i=1}^4 \max\{g_i(\mathbf{x}), 0\} \\
398
+ &\text{s.t.,} & g_1(\mathbf{x}) & = 1.0 - \frac{\sigma_b}{\sigma_{b,max}} \geq 0,\\
399
+ & & g_2(\mathbf{x}) & = 1.0 - \frac{\tau}{\tau_{max}} \geq 0, \\
400
+ & & g_3(\mathbf{x}) & = 1.0 - \frac{\delta}{\delta_{max}} \geq 0, \\
401
+ & & g_4(\mathbf{x}) & = 1.0 - \frac{\sigma_b}{\sigma_{k}} \geq 0,
402
+ \end{align}
403
+
404
+ where $x_1 \in [0.5, 4]$ and $x_2 \in [4, 50]$. The parameters are defined as $\sigma_{b,max} = 700 kg/cm^2$,
405
+ $\tau_{max} = 450 kg/cm$, $\delta_{max} = 1.5 cm$, $\sigma_k = Ex_1^2/100 kg/cm^2$,
406
+ $\sigma_b = 4500/(x_1x_2) kg/cm^2$, $\tau = 1800/x_2 kg/cm^2$, $\delta = 56.2 \times 10^4/(Ex_1x_2^2)$,
407
+ and $E = 700\,000 kg/cm^2$.
408
+
409
+ References:
410
+ Amir, H. M., & Hasegawa, T. (1989). Nonlinear mixed-discrete structural optimization.
411
+ Journal of Structural Engineering, 115(3), 626-646.
412
+
413
+ Tanabe, R. & Ishibuchi, H. (2020). An easy-to-use real-world multi-objective
414
+ optimization problem suite. Applied soft computing, 89, 106078.
415
+ https://doi.org/10.1016/j.asoc.2020.106078.
416
+
417
+ https://github.com/ryojitanabe/reproblems/blob/master/reproblem_python_ver/reproblem.py
418
+
419
+ Returns:
420
+ Problem: an instance of the hatch cover design problem.
421
+ """
422
+ x_1 = Variable(name="x_1", symbol="x_1", variable_type=VariableTypeEnum.real, lowerbound=0.5, upperbound=4)
423
+ x_2 = Variable(name="x_2", symbol="x_2", variable_type=VariableTypeEnum.real, lowerbound=4, upperbound=50)
424
+
425
+ sigma_b = "(4500 / (x_1 * x_2))"
426
+ sigma_k = "((700000 * x_1**2) / 100)"
427
+ tau = "(1800 / x_2)"
428
+ delta = "(56.2 * 10**4 / (700000 * x_1 * x_2**2))"
429
+
430
+ g_1 = Constraint(
431
+ name="g_1",
432
+ symbol="g_1",
433
+ cons_type=ConstraintTypeEnum.LTE,
434
+ func=f"-(1 - {sigma_b} / 700)",
435
+ is_linear=False,
436
+ is_convex=False, # Not checked
437
+ is_twice_differentiable=True,
438
+ )
439
+ g_2 = Constraint(
440
+ name="g_2",
441
+ symbol="g_2",
442
+ cons_type=ConstraintTypeEnum.LTE,
443
+ func=f"-(1 - {tau} / 450)",
444
+ is_linear=False,
445
+ is_convex=False, # Not checked
446
+ is_twice_differentiable=True,
447
+ )
448
+ g_3 = Constraint(
449
+ name="g_3",
450
+ symbol="g_3",
451
+ cons_type=ConstraintTypeEnum.LTE,
452
+ func=f"-(1 - {delta} / 1.5)",
453
+ is_linear=False,
454
+ is_convex=False, # Not checked
455
+ is_twice_differentiable=True,
456
+ )
457
+ g_4 = Constraint(
458
+ name="g_4",
459
+ symbol="g_4",
460
+ cons_type=ConstraintTypeEnum.LTE,
461
+ func=f"-(1 - {sigma_b} / {sigma_k})",
462
+ is_linear=False,
463
+ is_convex=False, # Not checked
464
+ is_twice_differentiable=True,
465
+ )
466
+
467
+ f_1 = Objective(
468
+ name="f_1",
469
+ symbol="f_1",
470
+ func="x_1 + 120 * x_2",
471
+ objective_type=ObjectiveTypeEnum.analytical,
472
+ is_linear=True,
473
+ is_convex=False, # Not checked
474
+ is_twice_differentiable=True,
475
+ )
476
+ f_2 = Objective(
477
+ name="f_2",
478
+ symbol="f_2",
479
+ func=f"Max(-(1 - {sigma_b} / 700), 0) + Max(-(1 - {tau} / 450), 0) + "
480
+ f"Max(-(1 - {delta} / 1.5), 0) + Max(-(1 - {sigma_b} / {sigma_k}), 0)",
481
+ objective_type=ObjectiveTypeEnum.analytical,
482
+ is_linear=False,
483
+ is_convex=False, # Not checked
484
+ is_twice_differentiable=False,
485
+ )
486
+ return Problem(
487
+ name="re24",
488
+ description="The hatch cover design problem",
489
+ variables=[x_1, x_2],
490
+ objectives=[f_1, f_2],
491
+ constraints=[g_1, g_2, g_3, g_4],
492
+ )