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.
Files changed (46) hide show
  1. pydmoo/algorithms/base/core/genetic.py +2 -2
  2. pydmoo/algorithms/base/dmoo/dmoead.py +8 -5
  3. pydmoo/algorithms/base/dmoo/dmoeadde.py +8 -5
  4. pydmoo/algorithms/base/dmoo/dnsga2.py +8 -5
  5. pydmoo/algorithms/base/moo/moead.py +2 -1
  6. pydmoo/algorithms/classic/__init__.py +0 -0
  7. pydmoo/algorithms/classic/moead_ae.py +77 -0
  8. pydmoo/algorithms/classic/moead_pps.py +94 -0
  9. pydmoo/algorithms/classic/moeadde_ae.py +77 -0
  10. pydmoo/algorithms/classic/moeadde_pps.py +94 -0
  11. pydmoo/algorithms/classic/nsga2_ae.py +76 -0
  12. pydmoo/algorithms/classic/nsga2_pps.py +94 -0
  13. pydmoo/algorithms/modern/moead_imkt.py +2 -1
  14. pydmoo/algorithms/modern/moead_imkt_igp.py +2 -1
  15. pydmoo/algorithms/modern/moead_imkt_lstm.py +2 -1
  16. pydmoo/algorithms/modern/moead_imkt_n.py +2 -1
  17. pydmoo/algorithms/modern/moead_imkt_n_igp.py +2 -1
  18. pydmoo/algorithms/modern/moead_imkt_n_lstm.py +2 -1
  19. pydmoo/algorithms/modern/moead_ktmm.py +2 -1
  20. pydmoo/algorithms/modern/moeadde_imkt.py +2 -1
  21. pydmoo/algorithms/modern/moeadde_imkt_clstm.py +2 -1
  22. pydmoo/algorithms/modern/moeadde_imkt_igp.py +2 -1
  23. pydmoo/algorithms/modern/moeadde_imkt_lstm.py +2 -1
  24. pydmoo/algorithms/modern/moeadde_imkt_n.py +2 -1
  25. pydmoo/algorithms/modern/moeadde_imkt_n_clstm.py +2 -1
  26. pydmoo/algorithms/modern/moeadde_imkt_n_igp.py +2 -1
  27. pydmoo/algorithms/modern/moeadde_imkt_n_lstm.py +2 -1
  28. pydmoo/algorithms/modern/moeadde_ktmm.py +2 -1
  29. pydmoo/algorithms/modern/nsga2_imkt.py +2 -1
  30. pydmoo/algorithms/modern/nsga2_imkt_clstm.py +2 -1
  31. pydmoo/algorithms/modern/nsga2_imkt_igp.py +2 -1
  32. pydmoo/algorithms/modern/nsga2_imkt_lstm.py +2 -1
  33. pydmoo/algorithms/modern/nsga2_imkt_n.py +2 -1
  34. pydmoo/algorithms/modern/nsga2_imkt_n_clstm.py +2 -1
  35. pydmoo/algorithms/modern/nsga2_imkt_n_igp.py +2 -1
  36. pydmoo/algorithms/modern/nsga2_imkt_n_lstm.py +2 -1
  37. pydmoo/algorithms/modern/nsga2_ktmm.py +2 -1
  38. pydmoo/problems/dyn.py +110 -15
  39. pydmoo/problems/dynamic/cec2015.py +2 -1
  40. pydmoo/problems/dynamic/df.py +2 -1
  41. pydmoo/problems/dynamic/gts.py +641 -82
  42. {pydmoo-0.1.0.dist-info → pydmoo-0.1.2.dist-info}/METADATA +1 -1
  43. pydmoo-0.1.2.dist-info/RECORD +77 -0
  44. pydmoo-0.1.0.dist-info/RECORD +0 -70
  45. {pydmoo-0.1.0.dist-info → pydmoo-0.1.2.dist-info}/WHEEL +0 -0
  46. {pydmoo-0.1.0.dist-info → pydmoo-0.1.2.dist-info}/licenses/LICENSE +0 -0
@@ -16,7 +16,8 @@ class MOEADIMKTIGP(MOEADIMKT):
16
16
  self.sigma_n = 0.01
17
17
  self.sigma_n_2 = self.sigma_n ** 2
18
18
 
19
- def _response_change(self):
19
+ def _response_mechanism(self):
20
+ """Response mechanism."""
20
21
  pop = self.pop
21
22
  X = pop.get("X")
22
23
 
@@ -42,7 +42,8 @@ class MOEADIMLSTM(MOEADIMKT):
42
42
  incremental_learning=self._incremental_learning,
43
43
  )
44
44
 
45
- def _response_change(self):
45
+ def _response_mechanism(self):
46
+ """Response mechanism."""
46
47
  pop = self.pop
47
48
  X = pop.get("X")
48
49
 
@@ -19,7 +19,8 @@ class MOEADIMKTN(MOEADIMKT):
19
19
  self.size_pool = 10
20
20
  self.denominator = 0.5
21
21
 
22
- def _response_change(self):
22
+ def _response_mechanism(self):
23
+ """Response mechanism."""
23
24
  pop = self.pop
24
25
  X = pop.get("X")
25
26
 
@@ -16,7 +16,8 @@ class MOEADIMKTNIGP(MOEADIMKTN):
16
16
  self.sigma_n = 0.01
17
17
  self.sigma_n_2 = self.sigma_n ** 2
18
18
 
19
- def _response_change(self):
19
+ def _response_mechanism(self):
20
+ """Response mechanism."""
20
21
  pop = self.pop
21
22
  X = pop.get("X")
22
23
 
@@ -43,7 +43,8 @@ class MOEADIMNLSTM(MOEADIMKTN):
43
43
  incremental_learning=self._incremental_learning,
44
44
  )
45
45
 
46
- def _response_change(self):
46
+ def _response_mechanism(self):
47
+ """Response mechanism."""
47
48
  pop = self.pop
48
49
  X = pop.get("X")
49
50
 
@@ -22,7 +22,8 @@ class MOEADKTMM(DMOEAD):
22
22
  self.size_pool = 14 # the size of knowledge pool
23
23
  self.denominator = 0.5
24
24
 
25
- def _response_change(self):
25
+ def _response_mechanism(self):
26
+ """Response mechanism."""
26
27
  pop = self.pop
27
28
  X = pop.get("X")
28
29
 
@@ -19,7 +19,8 @@ class MOEADDEIMKT(MOEADDEKTMM):
19
19
  self.size_pool = 10
20
20
  self.denominator = 0.5
21
21
 
22
- def _response_change(self):
22
+ def _response_mechanism(self):
23
+ """Response mechanism."""
23
24
  pop = self.pop
24
25
  X = pop.get("X")
25
26
 
@@ -36,7 +36,8 @@ class MOEADDEIMcLSTM(MOEADDEIMKT):
36
36
  incremental_learning=self._incremental_learning,
37
37
  )
38
38
 
39
- def _response_change(self):
39
+ def _response_mechanism(self):
40
+ """Response mechanism."""
40
41
  pop = self.pop
41
42
  X = pop.get("X")
42
43
 
@@ -16,7 +16,8 @@ class MOEADDEIMKTIGP(MOEADDEIMKT):
16
16
  self.sigma_n = 0.01
17
17
  self.sigma_n_2 = self.sigma_n ** 2
18
18
 
19
- def _response_change(self):
19
+ def _response_mechanism(self):
20
+ """Response mechanism."""
20
21
  pop = self.pop
21
22
  X = pop.get("X")
22
23
 
@@ -42,7 +42,8 @@ class MOEADDEIMLSTM(MOEADDEIMKT):
42
42
  incremental_learning=self._incremental_learning,
43
43
  )
44
44
 
45
- def _response_change(self):
45
+ def _response_mechanism(self):
46
+ """Response mechanism."""
46
47
  pop = self.pop
47
48
  X = pop.get("X")
48
49
 
@@ -19,7 +19,8 @@ class MOEADDEIMKTN(MOEADDEIMKT):
19
19
  self.size_pool = 10
20
20
  self.denominator = 0.5
21
21
 
22
- def _response_change(self):
22
+ def _response_mechanism(self):
23
+ """Response mechanism."""
23
24
  pop = self.pop
24
25
  X = pop.get("X")
25
26
 
@@ -37,7 +37,8 @@ class MOEADDEIMNcLSTM(MOEADDEIMKTN):
37
37
  incremental_learning=self._incremental_learning,
38
38
  )
39
39
 
40
- def _response_change(self):
40
+ def _response_mechanism(self):
41
+ """Response mechanism."""
41
42
  pop = self.pop
42
43
  X = pop.get("X")
43
44
 
@@ -16,7 +16,8 @@ class MOEADDEIMKTNIGP(MOEADDEIMKTN):
16
16
  self.sigma_n = 0.01
17
17
  self.sigma_n_2 = self.sigma_n ** 2
18
18
 
19
- def _response_change(self):
19
+ def _response_mechanism(self):
20
+ """Response mechanism."""
20
21
  pop = self.pop
21
22
  X = pop.get("X")
22
23
 
@@ -43,7 +43,8 @@ class MOEADDEIMNLSTM(MOEADDEIMKTN):
43
43
  incremental_learning=self._incremental_learning,
44
44
  )
45
45
 
46
- def _response_change(self):
46
+ def _response_mechanism(self):
47
+ """Response mechanism."""
47
48
  pop = self.pop
48
49
  X = pop.get("X")
49
50
 
@@ -22,7 +22,8 @@ class MOEADDEKTMM(DMOEADDE):
22
22
  self.size_pool = 14 # the size of knowledge pool
23
23
  self.denominator = 0.5
24
24
 
25
- def _response_change(self):
25
+ def _response_mechanism(self):
26
+ """Response mechanism."""
26
27
  pop = self.pop
27
28
  X = pop.get("X")
28
29
 
@@ -19,7 +19,8 @@ class NSGA2IMKT(NSGA2KTMM):
19
19
  self.size_pool = 10
20
20
  self.denominator = 0.5
21
21
 
22
- def _response_change(self):
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")
@@ -36,7 +36,8 @@ class NSGA2IMcLSTM(NSGA2IMKT):
36
36
  incremental_learning=self._incremental_learning,
37
37
  )
38
38
 
39
- def _response_change(self):
39
+ def _response_mechanism(self):
40
+ """Response mechanism."""
40
41
  pop = self.pop
41
42
  X = pop.get("X")
42
43
 
@@ -16,7 +16,8 @@ class NSGA2IMKTIGP(NSGA2IMKT):
16
16
  self.sigma_n = 0.01
17
17
  self.sigma_n_2 = self.sigma_n ** 2
18
18
 
19
- def _response_change(self):
19
+ def _response_mechanism(self):
20
+ """Response mechanism."""
20
21
  pop = self.pop
21
22
  X = pop.get("X")
22
23
 
@@ -41,7 +41,8 @@ class NSGA2IMLSTM(NSGA2IMKT):
41
41
  incremental_learning=self._incremental_learning,
42
42
  )
43
43
 
44
- def _response_change(self):
44
+ def _response_mechanism(self):
45
+ """Response mechanism."""
45
46
  pop = self.pop
46
47
  X = pop.get("X")
47
48
 
@@ -19,7 +19,8 @@ class NSGA2IMKTN(NSGA2IMKT):
19
19
  self.size_pool = 10
20
20
  self.denominator = 0.5
21
21
 
22
- def _response_change(self):
22
+ def _response_mechanism(self):
23
+ """Response mechanism."""
23
24
  pop = self.pop
24
25
  X = pop.get("X")
25
26
 
@@ -37,7 +37,8 @@ class NSGA2IMNcLSTM(NSGA2IMKTN):
37
37
  incremental_learning=self._incremental_learning,
38
38
  )
39
39
 
40
- def _response_change(self):
40
+ def _response_mechanism(self):
41
+ """Response mechanism."""
41
42
  pop = self.pop
42
43
  X = pop.get("X")
43
44
 
@@ -16,7 +16,8 @@ class NSGA2IMKTNIGP(NSGA2IMKTN):
16
16
  self.sigma_n = 0.01
17
17
  self.sigma_n_2 = self.sigma_n ** 2
18
18
 
19
- def _response_change(self):
19
+ def _response_mechanism(self):
20
+ """Response mechanism."""
20
21
  pop = self.pop
21
22
  X = pop.get("X")
22
23
 
@@ -42,7 +42,8 @@ class NSGA2IMNLSTM(NSGA2IMKTN):
42
42
  incremental_learning=self._incremental_learning,
43
43
  )
44
44
 
45
- def _response_change(self):
45
+ def _response_mechanism(self):
46
+ """Response mechanism."""
46
47
  pop = self.pop
47
48
  X = pop.get("X")
48
49
 
@@ -22,7 +22,8 @@ class NSGA2KTMM(DNSGA2):
22
22
  self.size_pool = 14 # the size of knowledge pool
23
23
  self.denominator = 0.5
24
24
 
25
- def _response_change(self):
25
+ def _response_mechanism(self):
26
+ """Response mechanism."""
26
27
  pop = self.pop
27
28
  X = pop.get("X")
28
29
 
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
- - [dyn.py](https://github.com/anyoptimization/pymoo/blob/main/pymoo/problems/dyn.py)
6
-
7
- Licensed under the Apache License, Version 2.0. Original copyright and license terms are preserved.
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
- - [cec2015.py](https://github.com/anyoptimization/pymoo/blob/main/pymoo/problems/dynamic/cec2015.py)
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
 
@@ -2,7 +2,8 @@
2
2
  Includes modified code from [pymoo](https://github.com/anyoptimization/pymoo).
3
3
 
4
4
  Sources:
5
- - [df.py](https://github.com/anyoptimization/pymoo/blob/main/pymoo/problems/dynamic/df.py)
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
  """