pymoo 0.6.1.3__cp312-cp312-win_amd64.whl → 0.6.1.5.dev0__cp312-cp312-win_amd64.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.
Potentially problematic release.
This version of pymoo might be problematic. Click here for more details.
- pymoo/algorithms/moo/age.py +13 -7
- pymoo/algorithms/moo/age2.py +49 -19
- pymoo/algorithms/moo/ctaea.py +2 -2
- pymoo/algorithms/moo/kgb.py +9 -9
- pymoo/algorithms/moo/nsga3.py +2 -2
- pymoo/algorithms/moo/pinsga2.py +370 -0
- pymoo/algorithms/moo/rnsga3.py +2 -2
- pymoo/algorithms/soo/nonconvex/es.py +3 -2
- pymoo/config.py +1 -1
- pymoo/core/algorithm.py +1 -1
- pymoo/core/individual.py +8 -7
- pymoo/core/replacement.py +5 -5
- pymoo/core/survival.py +1 -1
- pymoo/core/variable.py +9 -9
- pymoo/cython/calc_perpendicular_distance.cp312-win_amd64.pyd +0 -0
- pymoo/cython/calc_perpendicular_distance.cpp +27467 -0
- pymoo/cython/calc_perpendicular_distance.pyx +67 -0
- pymoo/cython/decomposition.cp312-win_amd64.pyd +0 -0
- pymoo/cython/decomposition.cpp +28877 -0
- pymoo/cython/decomposition.pyx +165 -0
- pymoo/cython/hv.cp312-win_amd64.pyd +0 -0
- pymoo/cython/hv.cpp +27559 -0
- pymoo/cython/hv.pyx +18 -0
- pymoo/cython/info.cp312-win_amd64.pyd +0 -0
- pymoo/cython/info.cpp +6653 -0
- pymoo/cython/info.pyx +5 -0
- pymoo/cython/mnn.cp312-win_amd64.pyd +0 -0
- pymoo/cython/mnn.cpp +30117 -0
- pymoo/cython/mnn.pyx +273 -0
- pymoo/cython/non_dominated_sorting.cp312-win_amd64.pyd +0 -0
- pymoo/cython/non_dominated_sorting.cpp +35256 -0
- pymoo/cython/non_dominated_sorting.pyx +645 -0
- pymoo/cython/pruning_cd.cp312-win_amd64.pyd +0 -0
- pymoo/cython/pruning_cd.cpp +29277 -0
- pymoo/cython/pruning_cd.pyx +197 -0
- pymoo/cython/stochastic_ranking.cp312-win_amd64.pyd +0 -0
- pymoo/cython/stochastic_ranking.cpp +27872 -0
- pymoo/cython/stochastic_ranking.pyx +49 -0
- pymoo/cython/vendor/hypervolume.cpp +1621 -0
- pymoo/docs.py +1 -1
- pymoo/operators/crossover/ox.py +1 -1
- pymoo/operators/selection/rnd.py +2 -2
- pymoo/operators/selection/tournament.py +5 -5
- pymoo/optimize.py +2 -2
- pymoo/problems/dynamic/df.py +4 -4
- pymoo/problems/single/traveling_salesman.py +1 -1
- pymoo/util/misc.py +2 -2
- pymoo/util/mnn.py +2 -2
- pymoo/util/nds/fast_non_dominated_sort.py +5 -3
- pymoo/util/nds/non_dominated_sorting.py +2 -2
- pymoo/util/normalization.py +5 -8
- pymoo/util/ref_dirs/energy.py +4 -2
- pymoo/util/ref_dirs/reduction.py +1 -1
- pymoo/util/reference_direction.py +3 -2
- pymoo/util/value_functions.py +719 -0
- pymoo/util/vf_dominator.py +99 -0
- pymoo/version.py +1 -1
- pymoo/visualization/heatmap.py +3 -3
- pymoo/visualization/pcp.py +1 -1
- pymoo/visualization/radar.py +1 -1
- {pymoo-0.6.1.3.dist-info → pymoo-0.6.1.5.dev0.dist-info}/METADATA +12 -13
- {pymoo-0.6.1.3.dist-info → pymoo-0.6.1.5.dev0.dist-info}/RECORD +65 -45
- {pymoo-0.6.1.3.dist-info → pymoo-0.6.1.5.dev0.dist-info}/WHEEL +1 -1
- {pymoo-0.6.1.3.dist-info → pymoo-0.6.1.5.dev0.dist-info/licenses}/LICENSE +0 -0
- {pymoo-0.6.1.3.dist-info → pymoo-0.6.1.5.dev0.dist-info}/top_level.txt +0 -0
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import numpy as np
|
|
2
|
+
import math
|
|
2
3
|
|
|
3
4
|
from pymoo.algorithms.base.genetic import GeneticAlgorithm
|
|
4
5
|
from pymoo.algorithms.soo.nonconvex.ga import FitnessSurvival
|
|
@@ -43,9 +44,9 @@ class ES(GeneticAlgorithm):
|
|
|
43
44
|
"""
|
|
44
45
|
|
|
45
46
|
if pop_size is None and n_offsprings is not None:
|
|
46
|
-
pop_size = int(
|
|
47
|
+
pop_size = int(math.ceil(n_offsprings * rule))
|
|
47
48
|
elif n_offsprings is None and pop_size is not None:
|
|
48
|
-
n_offsprings = int(
|
|
49
|
+
n_offsprings = int(math.floor(pop_size / rule))
|
|
49
50
|
|
|
50
51
|
assert pop_size is not None and n_offsprings is not None, "You have to at least provivde pop_size of n_offsprings."
|
|
51
52
|
assert n_offsprings >= 2 * pop_size, "The number of offsprings should be at least double the population size."
|
pymoo/config.py
CHANGED
|
@@ -22,7 +22,7 @@ class Config:
|
|
|
22
22
|
# whether when import a file the doc should be parsed - only activate when creating doc files
|
|
23
23
|
parse_custom_docs = False
|
|
24
24
|
|
|
25
|
-
# a method defining the endpoint to load data remotely - default from
|
|
25
|
+
# a method defining the endpoint to load data remotely - default from GitHub repo
|
|
26
26
|
@classmethod
|
|
27
27
|
def data(cls):
|
|
28
28
|
return f"https://raw.githubusercontent.com/anyoptimization/pymoo-data/main/"
|
pymoo/core/algorithm.py
CHANGED
|
@@ -261,7 +261,7 @@ class Algorithm:
|
|
|
261
261
|
opt = None
|
|
262
262
|
|
|
263
263
|
# if no feasible solution has been found
|
|
264
|
-
elif not np.any(opt.get("
|
|
264
|
+
elif not np.any(opt.get("FEAS")):
|
|
265
265
|
if self.return_least_infeasible:
|
|
266
266
|
opt = filter_optimum(opt, least_infeasible=True)
|
|
267
267
|
else:
|
pymoo/core/individual.py
CHANGED
|
@@ -12,6 +12,7 @@ __all__ = [
|
|
|
12
12
|
]
|
|
13
13
|
|
|
14
14
|
import copy
|
|
15
|
+
from typing import Any
|
|
15
16
|
from typing import Optional
|
|
16
17
|
from typing import Tuple
|
|
17
18
|
from typing import Union
|
|
@@ -48,7 +49,7 @@ class Individual:
|
|
|
48
49
|
def __init__(
|
|
49
50
|
self,
|
|
50
51
|
config: Optional[dict] = None,
|
|
51
|
-
**kwargs:
|
|
52
|
+
**kwargs: Any,
|
|
52
53
|
) -> None:
|
|
53
54
|
"""
|
|
54
55
|
Constructor for the ``Invididual`` class.
|
|
@@ -58,7 +59,7 @@ class Individual:
|
|
|
58
59
|
config : dict, None
|
|
59
60
|
A dictionary of configuration metadata.
|
|
60
61
|
If ``None``, use a class-dependent default configuration.
|
|
61
|
-
kwargs :
|
|
62
|
+
kwargs : Any
|
|
62
63
|
Additional keyword arguments containing data which is to be stored
|
|
63
64
|
in the ``Individual``.
|
|
64
65
|
"""
|
|
@@ -553,14 +554,14 @@ class Individual:
|
|
|
553
554
|
|
|
554
555
|
def set_by_dict(
|
|
555
556
|
self,
|
|
556
|
-
**kwargs:
|
|
557
|
+
**kwargs: Any
|
|
557
558
|
) -> None:
|
|
558
559
|
"""
|
|
559
560
|
Set an individual's data or metadata using values in a dictionary.
|
|
560
561
|
|
|
561
562
|
Parameters
|
|
562
563
|
----------
|
|
563
|
-
kwargs :
|
|
564
|
+
kwargs : Any
|
|
564
565
|
Keyword arguments defining the data to set.
|
|
565
566
|
"""
|
|
566
567
|
for k, v in kwargs.items():
|
|
@@ -594,15 +595,15 @@ class Individual:
|
|
|
594
595
|
|
|
595
596
|
def get(
|
|
596
597
|
self,
|
|
597
|
-
*keys:
|
|
598
|
+
*keys: str,
|
|
598
599
|
) -> Union[tuple,object]:
|
|
599
600
|
"""
|
|
600
601
|
Get the values for one or more keys for an individual.
|
|
601
602
|
|
|
602
603
|
Parameters
|
|
603
604
|
----------
|
|
604
|
-
keys :
|
|
605
|
-
|
|
605
|
+
keys : str
|
|
606
|
+
Keys for which to get values.
|
|
606
607
|
|
|
607
608
|
Returns
|
|
608
609
|
-------
|
pymoo/core/replacement.py
CHANGED
|
@@ -7,12 +7,12 @@ from pymoo.core.survival import Survival
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
def is_better(_new, _old, eps=0.0):
|
|
10
|
-
both_infeasible = not _old.
|
|
11
|
-
both_feasible = _old.
|
|
10
|
+
both_infeasible = not _old.feas and not _new.feas
|
|
11
|
+
both_feasible = _old.feas and _new.feas
|
|
12
12
|
|
|
13
13
|
if both_infeasible and _old.CV[0] - _new.CV[0] > eps:
|
|
14
14
|
return True
|
|
15
|
-
elif not _old.
|
|
15
|
+
elif not _old.FEAS and _new.FEAS:
|
|
16
16
|
return True
|
|
17
17
|
elif both_feasible and _old.F[0] - _new.F[0] > eps:
|
|
18
18
|
return True
|
|
@@ -59,8 +59,8 @@ class ImprovementReplacement(ReplacementSurvival):
|
|
|
59
59
|
|
|
60
60
|
ret = np.full((len(pop), 1), False)
|
|
61
61
|
|
|
62
|
-
pop_F, pop_CV, pop_feas = pop.get("F", "CV", "
|
|
63
|
-
off_F, off_CV, off_feas = off.get("F", "CV", "
|
|
62
|
+
pop_F, pop_CV, pop_feas = pop.get("F", "CV", "FEAS")
|
|
63
|
+
off_F, off_CV, off_feas = off.get("F", "CV", "FEAS")
|
|
64
64
|
|
|
65
65
|
if problem.has_constraints() > 0:
|
|
66
66
|
|
pymoo/core/survival.py
CHANGED
|
@@ -86,7 +86,7 @@ class ToReplacement(Survival):
|
|
|
86
86
|
|
|
87
87
|
|
|
88
88
|
def split_by_feasibility(pop, sort_infeas_by_cv=True, sort_feas_by_obj=False, return_pop=False):
|
|
89
|
-
F, CV, b = pop.get("F", "CV", "
|
|
89
|
+
F, CV, b = pop.get("F", "CV", "FEAS")
|
|
90
90
|
|
|
91
91
|
feasible = np.where(b)[0]
|
|
92
92
|
infeasible = np.where(~b)[0]
|
pymoo/core/variable.py
CHANGED
|
@@ -13,7 +13,7 @@ __all__ = [
|
|
|
13
13
|
"get",
|
|
14
14
|
]
|
|
15
15
|
|
|
16
|
-
from typing import Optional, Tuple
|
|
16
|
+
from typing import Any, Optional, Tuple
|
|
17
17
|
from typing import Union
|
|
18
18
|
import numpy as np
|
|
19
19
|
from numpy.typing import ArrayLike
|
|
@@ -111,14 +111,14 @@ class Variable(object):
|
|
|
111
111
|
|
|
112
112
|
def get(
|
|
113
113
|
self,
|
|
114
|
-
**kwargs:
|
|
114
|
+
**kwargs: Any
|
|
115
115
|
) -> object:
|
|
116
116
|
"""
|
|
117
117
|
Get the value of a decision variable.
|
|
118
118
|
|
|
119
119
|
Parameters
|
|
120
120
|
----------
|
|
121
|
-
kwargs :
|
|
121
|
+
kwargs : Any
|
|
122
122
|
Additional keyword arguments.
|
|
123
123
|
|
|
124
124
|
Returns
|
|
@@ -139,7 +139,7 @@ class BoundedVariable(Variable):
|
|
|
139
139
|
value: Optional[object] = None,
|
|
140
140
|
bounds: Tuple[Optional[object],Optional[object]] = (None, None),
|
|
141
141
|
strict: Optional[Tuple[Optional[object],Optional[object]]] = None,
|
|
142
|
-
**kwargs:
|
|
142
|
+
**kwargs: Any,
|
|
143
143
|
) -> None:
|
|
144
144
|
"""
|
|
145
145
|
Constructor for the ``BoundedVariable`` class.
|
|
@@ -154,7 +154,7 @@ class BoundedVariable(Variable):
|
|
|
154
154
|
strict : tuple, None
|
|
155
155
|
Strict boundaries for the decision variable.
|
|
156
156
|
If ``None``, the value of ``bounds`` is copied to ``strict``.
|
|
157
|
-
kwargs :
|
|
157
|
+
kwargs : Any
|
|
158
158
|
Additional keyword arguments for ``active`` and ``flag``.
|
|
159
159
|
"""
|
|
160
160
|
# call the Variable constructor
|
|
@@ -302,7 +302,7 @@ class Choice(Variable):
|
|
|
302
302
|
value: Optional[object] = None,
|
|
303
303
|
options: Optional[ArrayLike] = None,
|
|
304
304
|
all: Optional[ArrayLike] = None,
|
|
305
|
-
**kwargs:
|
|
305
|
+
**kwargs: Any,
|
|
306
306
|
) -> None:
|
|
307
307
|
"""
|
|
308
308
|
Constructor for the ``Choice`` class.
|
|
@@ -316,7 +316,7 @@ class Choice(Variable):
|
|
|
316
316
|
all : ArrayLike, None
|
|
317
317
|
A strict list of decision variable options from which to choose.
|
|
318
318
|
If ``None``, the value of ``options`` is copied to ``all``.
|
|
319
|
-
kwargs :
|
|
319
|
+
kwargs : Any
|
|
320
320
|
Additional keyword arguments for ``active`` and ``flag``.
|
|
321
321
|
"""
|
|
322
322
|
# all super constructor
|
|
@@ -357,7 +357,7 @@ class Choice(Variable):
|
|
|
357
357
|
def get(
|
|
358
358
|
*args: Tuple[Union[Variable,object],...],
|
|
359
359
|
size: Optional[Union[tuple,int]] = None,
|
|
360
|
-
**kwargs:
|
|
360
|
+
**kwargs: Any
|
|
361
361
|
) -> Union[tuple,object,None]:
|
|
362
362
|
"""
|
|
363
363
|
Get decision variable values from a tuple of ``Variable`` objects.
|
|
@@ -368,7 +368,7 @@ def get(
|
|
|
368
368
|
A tuple of ``Variable`` or ``object``s.
|
|
369
369
|
size : tuple, int, None
|
|
370
370
|
Size to reshape decision variables.
|
|
371
|
-
kwargs :
|
|
371
|
+
kwargs : Any
|
|
372
372
|
Additional keyword arguments to pass to the ``get`` method of the
|
|
373
373
|
``Variable`` class when getting decision variable values.
|
|
374
374
|
|
|
Binary file
|