pydmoo 0.1.0__py3-none-any.whl → 0.1.2__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.
- pydmoo/algorithms/base/core/genetic.py +2 -2
- pydmoo/algorithms/base/dmoo/dmoead.py +8 -5
- pydmoo/algorithms/base/dmoo/dmoeadde.py +8 -5
- pydmoo/algorithms/base/dmoo/dnsga2.py +8 -5
- pydmoo/algorithms/base/moo/moead.py +2 -1
- pydmoo/algorithms/classic/__init__.py +0 -0
- pydmoo/algorithms/classic/moead_ae.py +77 -0
- pydmoo/algorithms/classic/moead_pps.py +94 -0
- pydmoo/algorithms/classic/moeadde_ae.py +77 -0
- pydmoo/algorithms/classic/moeadde_pps.py +94 -0
- pydmoo/algorithms/classic/nsga2_ae.py +76 -0
- pydmoo/algorithms/classic/nsga2_pps.py +94 -0
- pydmoo/algorithms/modern/moead_imkt.py +2 -1
- pydmoo/algorithms/modern/moead_imkt_igp.py +2 -1
- pydmoo/algorithms/modern/moead_imkt_lstm.py +2 -1
- pydmoo/algorithms/modern/moead_imkt_n.py +2 -1
- pydmoo/algorithms/modern/moead_imkt_n_igp.py +2 -1
- pydmoo/algorithms/modern/moead_imkt_n_lstm.py +2 -1
- pydmoo/algorithms/modern/moead_ktmm.py +2 -1
- pydmoo/algorithms/modern/moeadde_imkt.py +2 -1
- pydmoo/algorithms/modern/moeadde_imkt_clstm.py +2 -1
- pydmoo/algorithms/modern/moeadde_imkt_igp.py +2 -1
- pydmoo/algorithms/modern/moeadde_imkt_lstm.py +2 -1
- pydmoo/algorithms/modern/moeadde_imkt_n.py +2 -1
- pydmoo/algorithms/modern/moeadde_imkt_n_clstm.py +2 -1
- pydmoo/algorithms/modern/moeadde_imkt_n_igp.py +2 -1
- pydmoo/algorithms/modern/moeadde_imkt_n_lstm.py +2 -1
- pydmoo/algorithms/modern/moeadde_ktmm.py +2 -1
- pydmoo/algorithms/modern/nsga2_imkt.py +2 -1
- pydmoo/algorithms/modern/nsga2_imkt_clstm.py +2 -1
- pydmoo/algorithms/modern/nsga2_imkt_igp.py +2 -1
- pydmoo/algorithms/modern/nsga2_imkt_lstm.py +2 -1
- pydmoo/algorithms/modern/nsga2_imkt_n.py +2 -1
- pydmoo/algorithms/modern/nsga2_imkt_n_clstm.py +2 -1
- pydmoo/algorithms/modern/nsga2_imkt_n_igp.py +2 -1
- pydmoo/algorithms/modern/nsga2_imkt_n_lstm.py +2 -1
- pydmoo/algorithms/modern/nsga2_ktmm.py +2 -1
- pydmoo/problems/dyn.py +110 -15
- pydmoo/problems/dynamic/cec2015.py +2 -1
- pydmoo/problems/dynamic/df.py +2 -1
- pydmoo/problems/dynamic/gts.py +641 -82
- {pydmoo-0.1.0.dist-info → pydmoo-0.1.2.dist-info}/METADATA +1 -1
- pydmoo-0.1.2.dist-info/RECORD +77 -0
- pydmoo-0.1.0.dist-info/RECORD +0 -70
- {pydmoo-0.1.0.dist-info → pydmoo-0.1.2.dist-info}/WHEEL +0 -0
- {pydmoo-0.1.0.dist-info → pydmoo-0.1.2.dist-info}/licenses/LICENSE +0 -0
|
@@ -19,7 +19,8 @@ class NSGA2IMKT(NSGA2KTMM):
|
|
|
19
19
|
self.size_pool = 10
|
|
20
20
|
self.denominator = 0.5
|
|
21
21
|
|
|
22
|
-
def
|
|
22
|
+
def _response_mechanism(self):
|
|
23
|
+
"""Response mechanism."""
|
|
23
24
|
"""Inverse Modeling with Knowledge Transfer."""
|
|
24
25
|
pop = self.pop
|
|
25
26
|
X = pop.get("X")
|
pydmoo/problems/dyn.py
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"""
|
|
2
2
|
Includes modified code from [pymoo](https://github.com/anyoptimization/pymoo).
|
|
3
3
|
|
|
4
|
-
Sources:
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
> Sources:
|
|
5
|
+
>
|
|
6
|
+
> - [dyn.py](https://github.com/anyoptimization/pymoo/blob/main/pymoo/problems/dyn.py)
|
|
7
|
+
>
|
|
8
|
+
> Licensed under the Apache License, Version 2.0. Original copyright and license terms are preserved.
|
|
8
9
|
"""
|
|
9
10
|
|
|
10
11
|
from abc import ABC
|
|
@@ -16,20 +17,66 @@ from pymoo.core.problem import Problem
|
|
|
16
17
|
|
|
17
18
|
|
|
18
19
|
class DynamicProblem(Problem, ABC):
|
|
20
|
+
"""Abstract base class for dynamic optimization problems."""
|
|
19
21
|
pass
|
|
20
22
|
|
|
21
23
|
|
|
22
24
|
class DynamicApplProblem(DynamicProblem):
|
|
25
|
+
"""Dynamic optimization problem for real-world applications.
|
|
26
|
+
|
|
27
|
+
This class defines dynamic optimization problems that model practical, real-world scenarios where the problem
|
|
28
|
+
characteristics change systematically over time.
|
|
29
|
+
|
|
30
|
+
Parameters
|
|
31
|
+
----------
|
|
32
|
+
nt : int
|
|
33
|
+
Severity of change. Controls how significantly the problem changes
|
|
34
|
+
at each change point. Higher values indicate more substantial changes
|
|
35
|
+
in problem characteristics.
|
|
36
|
+
taut : int
|
|
37
|
+
Frequency of change. Specifies how often (in generations) the problem
|
|
38
|
+
undergoes changes. Lower values mean more frequent changes.
|
|
39
|
+
t0 : int, optional
|
|
40
|
+
The first change occurs after t0 generations, by default 50.
|
|
41
|
+
That is, the generation at which a change occurs is (t0+1), (t0+taut+1), etc.
|
|
42
|
+
This allows for an initial stabilization period before the first change.
|
|
43
|
+
tau : int, optional
|
|
44
|
+
Current simulation time counter (in generations), by default 1.
|
|
45
|
+
time : float, optional
|
|
46
|
+
Explicit simulation time value (overrides calculated time), by default None.
|
|
47
|
+
Used for manual time control in specific scenarios.
|
|
48
|
+
**kwargs : dict
|
|
49
|
+
Additional keyword arguments passed to the parent Problem class.
|
|
50
|
+
|
|
51
|
+
Attributes
|
|
52
|
+
----------
|
|
53
|
+
tau : int
|
|
54
|
+
Current simulation time counter in generations.
|
|
55
|
+
nt : int
|
|
56
|
+
Severity of change at each change point.
|
|
57
|
+
taut : int
|
|
58
|
+
Frequency of change between consecutive changes.
|
|
59
|
+
t0 : int
|
|
60
|
+
Initial stabilization period before first change occurs.
|
|
61
|
+
|
|
62
|
+
Notes
|
|
63
|
+
-----
|
|
64
|
+
This class models real-world dynamic scenarios where:
|
|
65
|
+
|
|
66
|
+
- Changes occur at predictable intervals (every `taut` generations)
|
|
67
|
+
- Change severity is controlled by `nt` parameter
|
|
68
|
+
- Initial period `t0` allows for system stabilization
|
|
69
|
+
"""
|
|
23
70
|
|
|
24
|
-
def __init__(self, nt, taut, t0=50, tau=1, time=None, **kwargs):
|
|
71
|
+
def __init__(self, nt: int, taut: int, t0: int = 50, tau: int = 1, time: float | None = None, **kwargs):
|
|
25
72
|
super().__init__(**kwargs)
|
|
26
|
-
self.tau = tau
|
|
27
|
-
self.nt = nt
|
|
28
|
-
self.taut = taut
|
|
29
|
-
self.t0 = t0
|
|
73
|
+
self.tau = tau # time counter
|
|
74
|
+
self.nt = nt # severity of change
|
|
75
|
+
self.taut = taut # frequency of change
|
|
76
|
+
self.t0 = t0 # Initial time offset
|
|
30
77
|
self._time = time
|
|
31
78
|
|
|
32
|
-
def tic(self, elapsed=1):
|
|
79
|
+
def tic(self, elapsed: int = 1) -> None:
|
|
33
80
|
|
|
34
81
|
# increase the time counter by one
|
|
35
82
|
self.tau += elapsed
|
|
@@ -38,7 +85,7 @@ class DynamicApplProblem(DynamicProblem):
|
|
|
38
85
|
self.__dict__["cache"] = {}
|
|
39
86
|
|
|
40
87
|
@property
|
|
41
|
-
def time(self):
|
|
88
|
+
def time(self) -> float:
|
|
42
89
|
if self._time is not None:
|
|
43
90
|
return self._time
|
|
44
91
|
else:
|
|
@@ -54,7 +101,7 @@ class DynamicApplProblem(DynamicProblem):
|
|
|
54
101
|
return delta_time * count
|
|
55
102
|
|
|
56
103
|
@time.setter
|
|
57
|
-
def time(self, value):
|
|
104
|
+
def time(self, value: float) -> None:
|
|
58
105
|
self._time = value
|
|
59
106
|
|
|
60
107
|
def update_to_next_time(self):
|
|
@@ -77,12 +124,60 @@ class DynamicApplProblem(DynamicProblem):
|
|
|
77
124
|
|
|
78
125
|
|
|
79
126
|
class DynamicTestProblem(DynamicProblem):
|
|
127
|
+
"""Dynamic optimization problem for testing and benchmarking.
|
|
128
|
+
|
|
129
|
+
Parameters
|
|
130
|
+
----------
|
|
131
|
+
nt : int
|
|
132
|
+
Severity of change. Controls how significantly the problem changes
|
|
133
|
+
at each change point. Higher values indicate more substantial changes
|
|
134
|
+
in problem characteristics.
|
|
135
|
+
taut : int
|
|
136
|
+
Frequency of change. Specifies how often (in generations) the problem
|
|
137
|
+
undergoes changes. Lower values mean more frequent changes.
|
|
138
|
+
t0 : int, optional
|
|
139
|
+
The first change occurs after t0 generations, by default 50.
|
|
140
|
+
That is, the generation at which a change occurs is (t0+1), (t0+taut+1), etc.
|
|
141
|
+
This allows for an initial stabilization period before the first change.
|
|
142
|
+
tau : int, optional
|
|
143
|
+
Current simulation time counter (in generations), by default 1.
|
|
144
|
+
time : float, optional
|
|
145
|
+
Explicit simulation time value (overrides calculated time), by default None.
|
|
146
|
+
Used for manual time control in specific scenarios.
|
|
147
|
+
add_time_perturbation : bool, optional
|
|
148
|
+
If True, adds perturbations to the time calculation, by default False.
|
|
149
|
+
**kwargs : dict
|
|
150
|
+
Additional keyword arguments passed to the parent Problem class.
|
|
151
|
+
|
|
152
|
+
Attributes
|
|
153
|
+
----------
|
|
154
|
+
tau : int
|
|
155
|
+
Current simulation time counter in generations.
|
|
156
|
+
nt : int
|
|
157
|
+
Severity of change at each change point.
|
|
158
|
+
taut : int
|
|
159
|
+
Frequency of change between consecutive changes.
|
|
160
|
+
t0 : int
|
|
161
|
+
Initial stabilization period before first change occurs.
|
|
162
|
+
add_time_perturbation : bool
|
|
163
|
+
Flag indicating whether to add stochastic perturbations.
|
|
164
|
+
|
|
165
|
+
Notes
|
|
166
|
+
-----
|
|
167
|
+
This class is designed for testing scenarios where:
|
|
168
|
+
|
|
169
|
+
- Changes occur at predictable intervals (every `taut` generations)
|
|
170
|
+
- Change severity is controlled by `nt` parameter
|
|
171
|
+
- Initial period `t0` allows for system stabilization
|
|
172
|
+
- Stochastic perturbations can be added for more complex testing
|
|
173
|
+
- Reproducibility is important for benchmarking
|
|
174
|
+
"""
|
|
80
175
|
|
|
81
176
|
def __init__(self, nt, taut, t0=50, tau=1, time=None, add_time_perturbation=False, **kwargs):
|
|
82
177
|
super().__init__(**kwargs)
|
|
83
|
-
self.tau = tau
|
|
84
|
-
self.nt = nt
|
|
85
|
-
self.taut = taut
|
|
178
|
+
self.tau = tau # time counter
|
|
179
|
+
self.nt = nt # severity of change
|
|
180
|
+
self.taut = taut # frequency of change
|
|
86
181
|
self.t0 = t0 # Initial time offset - added by DynOpt Team
|
|
87
182
|
self._time = time
|
|
88
183
|
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
Includes modified code from [pymoo](https://github.com/anyoptimization/pymoo).
|
|
3
3
|
|
|
4
4
|
Sources:
|
|
5
|
-
|
|
5
|
+
|
|
6
|
+
- [cec2015.py](https://github.com/anyoptimization/pymoo/blob/main/pymoo/problems/dynamic/cec2015.py)
|
|
6
7
|
|
|
7
8
|
Licensed under the Apache License, Version 2.0. Original copyright and license terms are preserved.
|
|
8
9
|
|
pydmoo/problems/dynamic/df.py
CHANGED
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
Includes modified code from [pymoo](https://github.com/anyoptimization/pymoo).
|
|
3
3
|
|
|
4
4
|
Sources:
|
|
5
|
-
|
|
5
|
+
|
|
6
|
+
- [df.py](https://github.com/anyoptimization/pymoo/blob/main/pymoo/problems/dynamic/df.py)
|
|
6
7
|
|
|
7
8
|
Licensed under the Apache License, Version 2.0. Original copyright and license terms are preserved.
|
|
8
9
|
"""
|