Skip to content

Commit 0d4225c

Browse files
committed
feat: Add example EMDO problem
Manual translation of the EMDO problem from the old problems.yaml file to the new format to check if schema supports storing all information from old format.
1 parent a0aab01 commit 0d4225c

1 file changed

Lines changed: 82 additions & 0 deletions

File tree

examples/emdo.py

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
from opltools import Library, Problem, Implementation
2+
from pydantic_yaml import to_yaml_str
3+
4+
#! - name: Electric Motor Design Optimization
5+
#! suite/generator/single: Single Problem
6+
#! variable type: Continuous, Integer
7+
#! dimensionality: '13'
8+
#! objectives: '1'
9+
#! constraints: 'yes'
10+
#! dynamic: 'no'
11+
#! noise: 'yes'
12+
#! multimodal: 'yes'
13+
#! multi-fidelity: 'no'
14+
#! source (real-world/artificial): Real-World Application
15+
#! implementation: Implementation not freely available
16+
#! textual description: The goal is to find a design of a synchronous electric motor
17+
#! for power steering systems that minimizes costs and satisfies all constraints.
18+
#! reference: https://dis.ijs.si/tea/Publications/Tusar23Multistep.pdf (paper in Slovene)
19+
#! other info:
20+
#! partial evaluations: 'no'
21+
#! full name: Electric Motor Design Optimization
22+
#! constraint properties: Hard Constraints, Soft Constraints, Box Constraints
23+
#! number of constraints: '12'
24+
#! description of multimodality: Constraints are multimodal
25+
#! key challenges / characteristics: Time-consuming solution evaluation, highly-constrained
26+
#! problem
27+
#! scientific motivation: Challenging to find good solutions in a limited time
28+
#! limitations: 'Unavailability, even if available, it wouldn''t be helpful to use
29+
#! for benchmarking due taking a long time to evaluate a single solution '
30+
#! implementation languages: Python
31+
#! approximate evaluation time: 8 minutes
32+
#! general: This is not an available problem, but could be interesting to show to
33+
#! researchers which difficulties appear in real-world problems
34+
35+
library = Library({
36+
"impl_emdo": Implementation(
37+
name="Electric Motor Design Optimization",
38+
description="Not publicly available",
39+
language="python",
40+
evaluation_time="8 minutes"
41+
),
42+
"fn_emdo": Problem(
43+
name="Electric Motor Design Optimization",
44+
description="""# Goal
45+
Find a design of a synchronous electric motor for power steering systems that minimizes costs and satisfies all constraints.
46+
47+
# Motivation
48+
Challenging to find good solutions in a limited time
49+
50+
# Key Challenges
51+
* Time-consuming solution evaluation,
52+
* highly-constrained problem
53+
* Constraints are multimodal
54+
55+
This is not an available problem, but could be interesting to show to researchers which difficulties appear in real-world problems""",
56+
objectives=[1],
57+
variables=[
58+
{"type": "continuous", "dim": {"min": None, "max": 13}},
59+
{"type": "integer", "dim": {"min": None, "max": 13}},
60+
],
61+
modality=["multimodal"],
62+
allows_partial_evaluation="no",
63+
constraints=[
64+
{"type": "box", "hard": "some", "number": 12}
65+
],
66+
dynamic_type=["no"],
67+
noise_type=["yes"],
68+
fidelity_levels=[1],
69+
source=["real-world"],
70+
references=[
71+
{
72+
"title": "A Multi-Step Evaluation Process in Electric Motor Design",
73+
"lang": "sj",
74+
"authors": ["Tea Tušar", "Peter Korošec", "Bogdan Filipič"],
75+
"link": {"url": "https://dis.ijs.si/tea/Publications/Tusar23Multistep.pdf"}
76+
}
77+
],
78+
implementations=["impl_emdo"]
79+
)
80+
})
81+
82+
print(to_yaml_str(library))

0 commit comments

Comments
 (0)