pymoo 0.6.1__cp310-cp310-win_amd64.whl → 0.6.1.2__cp310-cp310-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.

Files changed (38) hide show
  1. pymoo/algorithms/moo/age.py +3 -2
  2. pymoo/algorithms/moo/nsga3.py +1 -2
  3. pymoo/algorithms/moo/sms.py +4 -1
  4. pymoo/algorithms/soo/nonconvex/cmaes.py +1 -1
  5. pymoo/algorithms/soo/nonconvex/es.py +1 -1
  6. pymoo/algorithms/soo/nonconvex/optuna.py +1 -4
  7. pymoo/algorithms/soo/nonconvex/pattern.py +1 -1
  8. pymoo/constraints/adaptive.py +2 -2
  9. pymoo/constraints/eps.py +1 -1
  10. pymoo/core/algorithm.py +1 -0
  11. pymoo/core/individual.py +512 -49
  12. pymoo/core/plot.py +1 -1
  13. pymoo/core/result.py +3 -0
  14. pymoo/core/variable.py +310 -16
  15. pymoo/cython/calc_perpendicular_distance.cp310-win_amd64.pyd +0 -0
  16. pymoo/cython/decomposition.cp310-win_amd64.pyd +0 -0
  17. pymoo/cython/hv.cp310-win_amd64.pyd +0 -0
  18. pymoo/cython/info.cp310-win_amd64.pyd +0 -0
  19. pymoo/cython/mnn.cp310-win_amd64.pyd +0 -0
  20. pymoo/cython/non_dominated_sorting.cp310-win_amd64.pyd +0 -0
  21. pymoo/cython/pruning_cd.cp310-win_amd64.pyd +0 -0
  22. pymoo/cython/stochastic_ranking.cp310-win_amd64.pyd +0 -0
  23. pymoo/gradient/__init__.py +3 -1
  24. pymoo/gradient/grad_autograd.py +28 -4
  25. pymoo/operators/crossover/sbx.py +1 -1
  26. pymoo/util/display/single.py +1 -2
  27. pymoo/util/function_loader.py +31 -21
  28. pymoo/util/nds/dominance_degree_non_dominated_sort.py +159 -0
  29. pymoo/util/ref_dirs/__init__.py +2 -0
  30. pymoo/util/ref_dirs/energy.py +4 -5
  31. pymoo/util/ref_dirs/energy_layer.py +5 -4
  32. pymoo/util/ref_dirs/incremental.py +68 -0
  33. pymoo/version.py +1 -1
  34. {pymoo-0.6.1.dist-info → pymoo-0.6.1.2.dist-info}/METADATA +2 -3
  35. {pymoo-0.6.1.dist-info → pymoo-0.6.1.2.dist-info}/RECORD +38 -36
  36. {pymoo-0.6.1.dist-info → pymoo-0.6.1.2.dist-info}/WHEEL +1 -1
  37. {pymoo-0.6.1.dist-info → pymoo-0.6.1.2.dist-info}/LICENSE +0 -0
  38. {pymoo-0.6.1.dist-info → pymoo-0.6.1.2.dist-info}/top_level.txt +0 -0
@@ -167,7 +167,7 @@ class AGEMOEASurvival(Survival):
167
167
  p = self.compute_geometry(front, extreme, n)
168
168
 
169
169
  nn = np.linalg.norm(front, p, axis=1)
170
- distances = self.pairwise_distances(front, p) / nn[:, None]
170
+ distances = self.pairwise_distances(front, p) / (nn[:, None])
171
171
 
172
172
  neighbors = 2
173
173
  remaining = np.arange(m)
@@ -284,7 +284,7 @@ def normalize(front, extreme):
284
284
 
285
285
  try:
286
286
  hyperplane = np.linalg.solve(front[extreme], np.ones(n))
287
- if any(np.isnan(hyperplane)) or any(np.isinf(hyperplane)) or any(hyperplane < 0):
287
+ if any(np.isnan(hyperplane)) or any(np.isinf(hyperplane)) or any(hyperplane <= 0):
288
288
  normalization = np.max(front, axis=0)
289
289
  else:
290
290
  normalization = 1. / hyperplane
@@ -300,4 +300,5 @@ def normalize(front, extreme):
300
300
 
301
301
  return front, normalization
302
302
 
303
+
303
304
  parse_doc_string(AGEMOEA.__init__)
@@ -278,7 +278,6 @@ class HyperplaneNormalization:
278
278
  self.extreme_points = None
279
279
 
280
280
  def update(self, F, nds=None):
281
-
282
281
  # find or usually update the new ideal point - from feasible solutions
283
282
  self.ideal_point = np.min(np.vstack((self.ideal_point, F)), axis=0)
284
283
  self.worst_point = np.max(np.vstack((self.worst_point, F)), axis=0)
@@ -296,7 +295,7 @@ class HyperplaneNormalization:
296
295
  worst_of_front = np.max(F[nds, :], axis=0)
297
296
 
298
297
  self.nadir_point = get_nadir_point(self.extreme_points, self.ideal_point, self.worst_point,
299
- worst_of_population, worst_of_front)
298
+ worst_of_front, worst_of_population)
300
299
 
301
300
 
302
301
  def get_extreme_points_c(F, ideal_point, extreme_points=None):
@@ -137,7 +137,7 @@ class SMSEMOA(GeneticAlgorithm):
137
137
  pop_size=100,
138
138
  sampling=FloatRandomSampling(),
139
139
  selection=TournamentSelection(func_comp=cv_and_dom_tournament),
140
- crossover=SBX(prob_exch=0.5),
140
+ crossover=SBX(),
141
141
  mutation=PM(),
142
142
  survival=LeastHypervolumeContributionSurvival(),
143
143
  eliminate_duplicates=True,
@@ -184,6 +184,9 @@ class SMSEMOA(GeneticAlgorithm):
184
184
  # merge the offsprings with the current population
185
185
  if infills is not None:
186
186
  pop = Population.merge(self.pop, infills)
187
+ else:
188
+ pop = self.pop
189
+
187
190
 
188
191
  self.pop = self.survival.do(self.problem, pop, n_survive=self.pop_size, algorithm=self,
189
192
  ideal=ideal, nadir=nadir, **kwargs)
@@ -402,7 +402,7 @@ class CMAES(LocalSearch):
402
402
  self.norm = NoNormalization()
403
403
  self.options['bounds'] = [xl, xu]
404
404
 
405
- self.options['seed'] = self.seed
405
+ self.options['seed'] = kwargs.get('seed', self.seed)
406
406
 
407
407
  if isinstance(self.termination, MaximumGenerationTermination):
408
408
  self.options['maxiter'] = self.termination.n_max_gen
@@ -45,7 +45,7 @@ class ES(GeneticAlgorithm):
45
45
  if pop_size is None and n_offsprings is not None:
46
46
  pop_size = int(np.math.ceil(n_offsprings * rule))
47
47
  elif n_offsprings is None and pop_size is not None:
48
- n_offsprings = int(np.math.floor(n_offsprings / rule))
48
+ n_offsprings = int(np.math.floor(pop_size / rule))
49
49
 
50
50
  assert pop_size is not None and n_offsprings is not None, "You have to at least provivde pop_size of n_offsprings."
51
51
  assert n_offsprings >= 2 * pop_size, "The number of offsprings should be at least double the population size."
@@ -1,12 +1,9 @@
1
- import logging
2
-
3
- from optuna.logging import get_logger
4
-
5
1
  from pymoo.util.optimum import filter_optimum
6
2
 
7
3
  try:
8
4
  import optuna
9
5
  from optuna.samplers import TPESampler
6
+ from optuna.logging import get_logger
10
7
  except:
11
8
  raise Exception("Please install optuna: pip install optuna")
12
9
 
@@ -80,7 +80,7 @@ class PatternSearch(LocalSearch):
80
80
  def _next(self):
81
81
 
82
82
  # whether the last iteration has resulted in a new optimum or not
83
- has_improved = is_better(self._explr, self._center, eps=0.0)
83
+ has_improved = is_better(self._explr, self._center)
84
84
 
85
85
  # that means that the exploration did not find any new point and was thus unsuccessful
86
86
  if not has_improved:
@@ -40,7 +40,7 @@ class AdaptiveConstraintHandling(Meta, Algorithm):
40
40
  def _setup(self, _, **kwargs):
41
41
  self.evaluator = AttachConfigEvaluator(self.evaluator, self.config)
42
42
 
43
- def _adapt(self, config, infills=None, **kwargs):
43
+ def _adapt_constraint_handling(self, config, infills=None, **kwargs):
44
44
  pass
45
45
 
46
46
  def _initialize_advance(self, infills=None, **kwargs):
@@ -53,7 +53,7 @@ class AdaptiveConstraintHandling(Meta, Algorithm):
53
53
  super()._advance(infills=infills, **kwargs)
54
54
  copy_to_dict(self.default_config, self.config)
55
55
 
56
- self._adapt(self.adapted_config, infills=infills, **kwargs)
56
+ self._adapt_constraint_handling(self.adapted_config, infills=infills, **kwargs)
57
57
 
58
58
  def _infill(self):
59
59
  copy_to_dict(self.adapted_config, self.config)
pymoo/constraints/eps.py CHANGED
@@ -10,7 +10,7 @@ class AdaptiveEpsilonConstraintHandling(AdaptiveConstraintHandling):
10
10
  self.perc_eps_until = perc_eps_until
11
11
  self.max_cv = None
12
12
 
13
- def _adapt(self, config, **kwargs):
13
+ def _adapt_constraint_handling(self, config, **kwargs):
14
14
  t = self.termination.perc
15
15
  alpha = np.maximum(0.0, 1 - 1 / self.perc_eps_until * t)
16
16
  eps = alpha * self.max_cv
pymoo/core/algorithm.py CHANGED
@@ -253,6 +253,7 @@ class Algorithm:
253
253
 
254
254
  res.pop = self.pop
255
255
  res.archive = self.archive
256
+ res.data = self.data
256
257
 
257
258
  # get the optimal solution found
258
259
  opt = self.opt