desdeo 1.1.3__py3-none-any.whl → 2.0.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.
- desdeo/__init__.py +8 -8
- desdeo/api/README.md +73 -0
- desdeo/api/__init__.py +15 -0
- desdeo/api/app.py +40 -0
- desdeo/api/config.py +69 -0
- desdeo/api/config.toml +53 -0
- desdeo/api/db.py +25 -0
- desdeo/api/db_init.py +79 -0
- desdeo/api/db_models.py +164 -0
- desdeo/api/malaga_db_init.py +27 -0
- desdeo/api/models/__init__.py +66 -0
- desdeo/api/models/archive.py +34 -0
- desdeo/api/models/preference.py +90 -0
- desdeo/api/models/problem.py +507 -0
- desdeo/api/models/reference_point_method.py +18 -0
- desdeo/api/models/session.py +46 -0
- desdeo/api/models/state.py +96 -0
- desdeo/api/models/user.py +51 -0
- desdeo/api/routers/_NAUTILUS.py +245 -0
- desdeo/api/routers/_NAUTILUS_navigator.py +233 -0
- desdeo/api/routers/_NIMBUS.py +762 -0
- desdeo/api/routers/__init__.py +5 -0
- desdeo/api/routers/problem.py +110 -0
- desdeo/api/routers/reference_point_method.py +117 -0
- desdeo/api/routers/session.py +76 -0
- desdeo/api/routers/test.py +16 -0
- desdeo/api/routers/user_authentication.py +366 -0
- desdeo/api/schema.py +94 -0
- desdeo/api/tests/__init__.py +0 -0
- desdeo/api/tests/conftest.py +59 -0
- desdeo/api/tests/test_models.py +701 -0
- desdeo/api/tests/test_routes.py +216 -0
- desdeo/api/utils/database.py +274 -0
- desdeo/api/utils/logger.py +29 -0
- desdeo/core.py +27 -0
- desdeo/emo/__init__.py +29 -0
- desdeo/emo/hooks/archivers.py +172 -0
- desdeo/emo/methods/EAs.py +418 -0
- desdeo/emo/methods/__init__.py +0 -0
- desdeo/emo/methods/bases.py +59 -0
- desdeo/emo/operators/__init__.py +1 -0
- desdeo/emo/operators/crossover.py +780 -0
- desdeo/emo/operators/evaluator.py +118 -0
- desdeo/emo/operators/generator.py +356 -0
- desdeo/emo/operators/mutation.py +1053 -0
- desdeo/emo/operators/selection.py +1036 -0
- desdeo/emo/operators/termination.py +178 -0
- desdeo/explanations/__init__.py +6 -0
- desdeo/explanations/explainer.py +100 -0
- desdeo/explanations/utils.py +90 -0
- desdeo/mcdm/__init__.py +19 -0
- desdeo/mcdm/nautili.py +345 -0
- desdeo/mcdm/nautilus.py +477 -0
- desdeo/mcdm/nautilus_navigator.py +655 -0
- desdeo/mcdm/nimbus.py +417 -0
- desdeo/mcdm/pareto_navigator.py +269 -0
- desdeo/mcdm/reference_point_method.py +116 -0
- desdeo/problem/__init__.py +79 -0
- desdeo/problem/evaluator.py +561 -0
- desdeo/problem/gurobipy_evaluator.py +562 -0
- desdeo/problem/infix_parser.py +341 -0
- desdeo/problem/json_parser.py +944 -0
- desdeo/problem/pyomo_evaluator.py +468 -0
- desdeo/problem/schema.py +1808 -0
- desdeo/problem/simulator_evaluator.py +298 -0
- desdeo/problem/sympy_evaluator.py +244 -0
- desdeo/problem/testproblems/__init__.py +73 -0
- desdeo/problem/testproblems/binh_and_korn_problem.py +88 -0
- desdeo/problem/testproblems/dtlz2_problem.py +102 -0
- desdeo/problem/testproblems/forest_problem.py +275 -0
- desdeo/problem/testproblems/knapsack_problem.py +163 -0
- desdeo/problem/testproblems/mcwb_problem.py +831 -0
- desdeo/problem/testproblems/mixed_variable_dimenrions_problem.py +83 -0
- desdeo/problem/testproblems/momip_problem.py +172 -0
- desdeo/problem/testproblems/nimbus_problem.py +143 -0
- desdeo/problem/testproblems/pareto_navigator_problem.py +89 -0
- desdeo/problem/testproblems/re_problem.py +492 -0
- desdeo/problem/testproblems/river_pollution_problem.py +434 -0
- desdeo/problem/testproblems/rocket_injector_design_problem.py +140 -0
- desdeo/problem/testproblems/simple_problem.py +351 -0
- desdeo/problem/testproblems/simulator_problem.py +92 -0
- desdeo/problem/testproblems/spanish_sustainability_problem.py +945 -0
- desdeo/problem/testproblems/zdt_problem.py +271 -0
- desdeo/problem/utils.py +245 -0
- desdeo/tools/GenerateReferencePoints.py +181 -0
- desdeo/tools/__init__.py +102 -0
- desdeo/tools/generics.py +145 -0
- desdeo/tools/gurobipy_solver_interfaces.py +258 -0
- desdeo/tools/indicators_binary.py +11 -0
- desdeo/tools/indicators_unary.py +375 -0
- desdeo/tools/interaction_schema.py +38 -0
- desdeo/tools/intersection.py +54 -0
- desdeo/tools/iterative_pareto_representer.py +99 -0
- desdeo/tools/message.py +234 -0
- desdeo/tools/ng_solver_interfaces.py +199 -0
- desdeo/tools/non_dominated_sorting.py +133 -0
- desdeo/tools/patterns.py +281 -0
- desdeo/tools/proximal_solver.py +99 -0
- desdeo/tools/pyomo_solver_interfaces.py +464 -0
- desdeo/tools/reference_vectors.py +462 -0
- desdeo/tools/scalarization.py +3138 -0
- desdeo/tools/scipy_solver_interfaces.py +454 -0
- desdeo/tools/score_bands.py +464 -0
- desdeo/tools/utils.py +320 -0
- desdeo/utopia_stuff/__init__.py +0 -0
- desdeo/utopia_stuff/data/1.json +15 -0
- desdeo/utopia_stuff/data/2.json +13 -0
- desdeo/utopia_stuff/data/3.json +15 -0
- desdeo/utopia_stuff/data/4.json +17 -0
- desdeo/utopia_stuff/data/5.json +15 -0
- desdeo/utopia_stuff/from_json.py +40 -0
- desdeo/utopia_stuff/reinit_user.py +38 -0
- desdeo/utopia_stuff/utopia_db_init.py +212 -0
- desdeo/utopia_stuff/utopia_problem.py +403 -0
- desdeo/utopia_stuff/utopia_problem_old.py +415 -0
- desdeo/utopia_stuff/utopia_reference_solutions.py +79 -0
- desdeo-2.0.0.dist-info/LICENSE +21 -0
- desdeo-2.0.0.dist-info/METADATA +168 -0
- desdeo-2.0.0.dist-info/RECORD +120 -0
- {desdeo-1.1.3.dist-info → desdeo-2.0.0.dist-info}/WHEEL +1 -1
- desdeo-1.1.3.dist-info/METADATA +0 -18
- desdeo-1.1.3.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
|
+
)
|