Changeset 636
- Timestamp:
- 01/06/13 20:11:37 (3 years ago)
- Location:
- mystic/mystic
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
mystic/mystic/abstract_solver.py
r633 r636 323 323 self.SetRandomInitialPoints(min,max) 324 324 #stick initial values in population[i], i=0 325 self.population[0] = x0 #FIXME: 0 is array, 1: is list325 self.population[0] = x0.tolist() 326 326 327 327 def SetRandomInitialPoints(self, min=None, max=None): … … 344 344 #generate random initial values 345 345 for i in range(len(self.population)): 346 for j in range(self.nDim): #FIXME: 0: are lists346 for j in range(self.nDim): 347 347 self.population[i][j] = random.uniform(min[j],max[j]) 348 348 … … 368 368 else: 369 369 var = var * numpy.eye(self.nDim) 370 for i in range(len(self.population)): #FIXME: 0: are lists370 for i in range(len(self.population)): 371 371 self.population[i] = multivariate_normal(mean, var).tolist() 372 372 return -
mystic/mystic/differential_evolution.py
r634 r636 145 145 from abstract_map_solver import AbstractMapSolver 146 146 147 from numpy import asfarray 148 147 149 class DifferentialEvolutionSolver(AbstractSolver): 148 150 """ … … 222 224 """ 223 225 #allow for inputs that don't conform to AbstractSolver interface 226 self.population[0] = asfarray(self.population[0]) 224 227 from mystic.strategy import Best1Bin 225 228 strategy=Best1Bin #mutation strategy (see mystic.strategy) … … 402 405 """ 403 406 #allow for inputs that don't conform to AbstractSolver interface 407 self.population[0] = asfarray(self.population[0]) 404 408 from mystic.strategy import Best1Bin 405 409 strategy=Best1Bin #mutation strategy (see mystic.strategy)
Note: See TracChangeset
for help on using the changeset viewer.