Changeset 758
- Timestamp:
- 10/04/14 13:08:55 (20 months ago)
- Location:
- mystic/mystic
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
mystic/mystic/differential_evolution.py
r748 r758 146 146 147 147 from mystic.tools import wrap_function, unpair, isiterable 148 from mystic.tools import wrap_bounds, wrap_penalty, reduced148 from mystic.tools import wrap_bounds, wrap_penalty, wrap_nested, reduced 149 149 150 150 from mystic.abstract_solver import AbstractSolver … … 388 388 strategy(self, candidate) 389 389 # apply constraints 390 self.trialSolution[candidate][:] = self._constraints(self.trialSolution[candidate]) 390 #self.trialSolution[candidate][:] = self._constraints(self.trialSolution[candidate]) 391 # bind constraints to cost 392 concost = wrap_nested(cost, self._constraints) 391 393 392 394 # apply penalty 393 395 #trialEnergy = map(self._penalty, self.trialSolution)#,**self._mapconfig) 394 396 # calculate cost 395 trialEnergy = self._map(co st, self.trialSolution, **self._mapconfig)397 trialEnergy = self._map(concost, self.trialSolution, **self._mapconfig) 396 398 397 399 # each trialEnergy should be a scalar -
mystic/mystic/scipy_optimize.py
r748 r758 182 182 y[k] = val[k] 183 183 sim[k+1] = y 184 f = cost(y) 184 f = cost(y) #XXX: use self._map? 185 185 fsim[k+1] = f 186 186 … … 238 238 for j in one2np1: 239 239 sim[j] = sim[0] + sigma*(sim[j] - sim[0]) 240 fsim[j] = cost(sim[j]) 240 fsim[j] = cost(sim[j]) #XXX: use self._map? 241 241 242 242 if len(self._stepmon): … … 502 502 503 503 # apply constraints 504 x = asfarray(self._constraints(x)) 504 x = asfarray(self._constraints(x)) #XXX: use self._map? 505 505 # decouple from 'best' energy 506 506 self.energy_history = self.energy_history + [fval] … … 547 547 548 548 # apply constraints 549 x = asfarray(self._constraints(x)) 549 x = asfarray(self._constraints(x)) #XXX: use self._map? 550 550 551 551 # decouple from 'best' energy
Note: See TracChangeset
for help on using the changeset viewer.