Changeset 158
- Timestamp:
- 08/02/09 14:40:15 (7 years ago)
- Location:
- branches/alta/mystic-0.1a2
- Files:
-
- 2 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/alta/mystic-0.1a2/mystic/snobfit_solver.py
r155 r158 1 # Snobfit optimization (branch and bound) adapted to the Mystic framework2 3 1 """ 4 2 Solvers … … 68 66 from mystic.softConstraint import SoftConstraint, SoftConstraints 69 67 70 # ----------------------------------------------------------------- 71 72 # Mystic imports 68 # Import Mystic tools 73 69 from mystic.tools import Null, wrap_function, unpair 74 70 from mystic.tools import wrap_bounds … … 264 260 # code below here pushes output to scipy.optimize interface 265 261 fval = self.bestEnergy 266 warnflag = 0267 262 268 263 if fcalls[0] >= self._maxfun: 269 warnflag = 1270 264 if disp: 271 265 print "Warning: Maximum number of function evaluations has "\ 272 266 "been exceeded." 273 267 elif i >= self._maxiter: 274 warnflag = 2275 268 if disp: 276 269 print "Warning: Maximum number of iterations has been exceeded" -
branches/alta/mystic-0.1a2/mystic/termination.py
r151 r158 85 85 return _ 86 86 87 def AnnealTermination(feps=1e-6): 88 """Terminate if abs((population-x0)/x0) < feps""" 89 def _(inst): 90 sim = inst.population 91 return all(abs((sim-sim[0])/sim[0]) < feps) 92 return _ 93 87 94 # end of file
Note: See TracChangeset
for help on using the changeset viewer.