Changeset 463
- Timestamp:
- 06/21/11 12:47:16 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
mystic/mystic/nested.py
r456 r463 96 96 from python_map import python_map 97 97 if self._map != python_map: 98 fcalls = [0] #FIXME: temporary patch for removing the following line99 else: 100 fcalls, cost = wrap_function(cost, ExtraArgs, EvaluationMonitor)98 self._fcalls = [0] #FIXME: temporary patch for removing the following line 99 else: 100 self._fcalls, cost = wrap_function(cost, ExtraArgs, EvaluationMonitor) 101 101 102 102 #generate signal_handler … … 181 181 self.bestEnergy = best[1] 182 182 self.generations = len(bestpath.y) 183 fcalls = [ len(besteval.y) ]183 self._fcalls = [ len(besteval.y) ] 184 184 185 185 # write 'bests' to monitors #XXX: non-best monitors may be useful too … … 202 202 if self._maxfun is None: self._maxfun = self.nDim * 1e8 203 203 204 if fcalls[0] >= self._maxfun:204 if self._fcalls[0] >= self._maxfun: 205 205 warnflag = 1 206 206 if disp: … … 216 216 print " Current function value: %f" % fval 217 217 print " Iterations: %d" % self.generations 218 print " Function evaluations: %d" % fcalls[0]218 print " Function evaluations: %d" % self._fcalls[0] 219 219 220 220 return … … 277 277 from python_map import python_map 278 278 if self._map != python_map: 279 fcalls = [0] #FIXME: temporary patch for removing the following line280 else: 281 fcalls, cost = wrap_function(cost, ExtraArgs, EvaluationMonitor)279 self._fcalls = [0] #FIXME: temporary patch for removing the following line 280 else: 281 self._fcalls, cost = wrap_function(cost, ExtraArgs, EvaluationMonitor) 282 282 283 283 #generate signal_handler … … 355 355 self.bestEnergy = best[1] 356 356 self.generations = len(bestpath.y) 357 fcalls = [ len(besteval.y) ]357 self._fcalls = [ len(besteval.y) ] 358 358 359 359 # write 'bests' to monitors #XXX: non-best monitors may be useful too … … 376 376 if self._maxfun is None: self._maxfun = self.nDim * 1e8 377 377 378 if fcalls[0] >= self._maxfun:378 if self._fcalls[0] >= self._maxfun: 379 379 warnflag = 1 380 380 if disp: … … 390 390 print " Current function value: %f" % fval 391 391 print " Iterations: %d" % self.generations 392 print " Function evaluations: %d" % fcalls[0]392 print " Function evaluations: %d" % self._fcalls[0] 393 393 394 394 return
Note: See TracChangeset
for help on using the changeset viewer.