From: Jean-Philippe ARGAUD Date: Sun, 19 Mar 2017 20:03:06 +0000 (+0100) Subject: Minor correction to correctly handle array copy X-Git-Tag: V8_3_0rc1~14 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=9e8b1966fc8d1773b9d9bfd4e11101468c3ad0ba;p=modules%2Fadao.git Minor correction to correctly handle array copy --- diff --git a/src/daComposant/daAlgorithms/TabuSearch.py b/src/daComposant/daAlgorithms/TabuSearch.py index 161fd4a..415800d 100644 --- a/src/daComposant/daAlgorithms/TabuSearch.py +++ b/src/daComposant/daAlgorithms/TabuSearch.py @@ -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