]> SALOME platform Git repositories - modules/adao.git/commitdiff
Salome HOME
Minor correction to correctly handle array copy
authorJean-Philippe ARGAUD <jean-philippe.argaud@edf.fr>
Sun, 19 Mar 2017 20:03:06 +0000 (21:03 +0100)
committerJean-Philippe ARGAUD <jean-philippe.argaud@edf.fr>
Sun, 19 Mar 2017 20:03:06 +0000 (21:03 +0100)
src/daComposant/daAlgorithms/TabuSearch.py

index 161fd4ae8a659bc37d89885d2526386953d4c622..415800da4f2c0eb7771342e8fef4db6a4ab53470 100644 (file)
@@ -134,15 +134,15 @@ class ElementaryAlgorithm(BasicObjects.Algorithm):
         # Définition de la fonction de deplacement
         # ----------------------------------------
         def Tweak( x, NoiseDistribution, NoiseAddingProbability ):
-            _X  = numpy.asmatrix(numpy.ravel( x )).T
+            _X  = numpy.matrix(numpy.ravel( x )).T
             if NoiseDistribution == "Uniform":
-                for i in xrange(_X.size):
+                for i in range(_X.size):
                     if NoiseAddingProbability >= numpy.random.uniform():
                         _increment = numpy.random.uniform(low=-nrange[i], high=nrange[i])
                         # On ne traite pas encore le dépassement des bornes ici
                         _X[i] += _increment
             elif NoiseDistribution == "Gaussian":
-                for i in xrange(_X.size):
+                for i in range(_X.size):
                     if NoiseAddingProbability >= numpy.random.uniform():
                         _increment = numpy.random.normal(loc=0., scale=sigma[i])
                         # On ne traite pas encore le dépassement des bornes ici