From: Jean-Philippe ARGAUD Date: Fri, 28 Apr 2023 10:07:17 +0000 (+0200) Subject: Code review and minor update for PSO X-Git-Tag: V9_11_0b1~2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=904e6c82aae1c1b351c6363ac5d3d514a0502436;p=modules%2Fadao.git Code review and minor update for PSO --- diff --git a/doc/en/index.rst b/doc/en/index.rst index cdc5666..2eb2ffe 100644 --- a/doc/en/index.rst +++ b/doc/en/index.rst @@ -45,7 +45,7 @@ estimation*, *optimal interpolation*, *mathematical regularization*, *meta-heuristics for optimization*, *model reduction*, *data smoothing*, etc. More details can be found in the section :ref:`section_theory`. The ADAO module currently offers more than one hundred different algorithmic methods and allows -the study of about 350 distinct applied problems. +the study of about 400 distinct applied problems. The documentation for this module is divided into several major categories, related to the **theoretical documentation** (indicated in the section title by diff --git a/doc/fr/index.rst b/doc/fr/index.rst index fd23eef..4164da9 100644 --- a/doc/fr/index.rst +++ b/doc/fr/index.rst @@ -47,7 +47,7 @@ inverses*, *inversion*, *estimation bayésienne*, *interpolation optimale*, de modèles*, *lissage de données*, etc. De plus amples détails peuvent être trouvés dans la partie proposant :ref:`section_theory`. Le module ADAO offre actuellement plus d'une centaine de méthodes algorithmiques différentes et -permet l'étude d'environ 350 problèmes appliqués distincts. +permet l'étude d'environ 400 problèmes appliqués distincts. La documentation de ce module est divisée en plusieurs grandes catégories, relatives à la **documentation théorique** (indiquée dans le titre de section diff --git a/src/daComposant/daAlgorithms/Atoms/ecwnpso.py b/src/daComposant/daAlgorithms/Atoms/ecwnpso.py index 886ce54..fd097fa 100644 --- a/src/daComposant/daAlgorithms/Atoms/ecwnpso.py +++ b/src/daComposant/daAlgorithms/Atoms/ecwnpso.py @@ -44,6 +44,7 @@ def ecwnpso(selfA, Xb, Y, HO, R, B): selfA._parameters["BoxBounds"], Xini, selfA._name, + 0.5, # Similaire au SPSO-2011 ) # def CostFunction(x, QualityMeasure="AugmentedWeightedLeastSquares"): @@ -101,7 +102,7 @@ def ecwnpso(selfA, Xb, Y, HO, R, B): # Initialisation de l'essaim # -------------------------- LimitPlace = Bounds - LimitSpeed = 0.5 * BoxBounds # "1/2*([Xmin,Xmax]-Xini)" + LimitSpeed = BoxBounds # nbfct = 1 # Nb d'évaluations JXini, JbXini, JoXini = CostFunction(Xini,selfA._parameters["QualityCriterion"]) diff --git a/src/daComposant/daAlgorithms/Atoms/ecwopso.py b/src/daComposant/daAlgorithms/Atoms/ecwopso.py index e14f24b..cc59223 100644 --- a/src/daComposant/daAlgorithms/Atoms/ecwopso.py +++ b/src/daComposant/daAlgorithms/Atoms/ecwopso.py @@ -21,7 +21,7 @@ # Author: Jean-Philippe Argaud, jean-philippe.argaud@edf.fr, EDF R&D __doc__ = """ - Standard Particle Swarm Optimization + Simple Particle Swarm Optimization """ __author__ = "Jean-Philippe ARGAUD" @@ -44,6 +44,7 @@ def ecwopso(selfA, Xb, Y, HO, R, B): selfA._parameters["BoxBounds"], Xini, selfA._name, + 0.5, # Similaire au SPSO-2011 ) # def CostFunction(x, QualityMeasure="AugmentedWeightedLeastSquares"): @@ -101,7 +102,7 @@ def ecwopso(selfA, Xb, Y, HO, R, B): # Initialisation de l'essaim # -------------------------- LimitPlace = Bounds - LimitSpeed = 0.5 * BoxBounds # "1/2*([Xmin,Xmax]-Xini)" + LimitSpeed = BoxBounds # nbfct = 1 # Nb d'évaluations JXini, JbXini, JoXini = CostFunction(Xini,selfA._parameters["QualityCriterion"]) diff --git a/src/daComposant/daAlgorithms/Atoms/ecwspso.py b/src/daComposant/daAlgorithms/Atoms/ecwspso.py index c23a907..9b3dc2b 100644 --- a/src/daComposant/daAlgorithms/Atoms/ecwspso.py +++ b/src/daComposant/daAlgorithms/Atoms/ecwspso.py @@ -21,7 +21,7 @@ # Author: Jean-Philippe Argaud, jean-philippe.argaud@edf.fr, EDF R&D __doc__ = """ - SPSO-2011 Particle Swarm Optimization + Standard Particle Swarm Optimization 2011 """ __author__ = "Jean-Philippe ARGAUD" diff --git a/src/daComposant/daAlgorithms/ParticleSwarmOptimization.py b/src/daComposant/daAlgorithms/ParticleSwarmOptimization.py index 6fbbe16..7519e92 100644 --- a/src/daComposant/daAlgorithms/ParticleSwarmOptimization.py +++ b/src/daComposant/daAlgorithms/ParticleSwarmOptimization.py @@ -64,7 +64,7 @@ class ElementaryAlgorithm(BasicObjects.Algorithm): ) self.defineRequiredParameter( name = "NumberOfInsects", - default = 100, + default = 40, typecast = int, message = "Nombre d'insectes dans l'essaim", minval = -1,