Changeset 698
- Timestamp:
- 07/08/13 15:15:46 (3 years ago)
- Location:
- mystic/mystic
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
mystic/mystic/abstract_solver.py
r679 r698 604 604 return settings 605 605 606 def Solve(self, cost , termination=None, sigint_callback=None,607 ExtraArgs=(), **kwds):606 def Solve(self, cost=None, termination=None, sigint_callback=None, 607 ExtraArgs=None, **kwds): 608 608 """Minimize a 'cost' function with given termination conditions. 609 609 … … 629 629 the current parameter vector. [default = None] 630 630 disp -- non-zero to print convergence messages. 631 """ #FIXME: edit so "Solve" can be called anytime to "finish" the solve 632 #FIXME: needs to respect when evals/iters have been done already 631 """ 632 # HACK to enable not explicitly calling _RegisterObjective 633 cost = self._bootstrap_decorate(cost, ExtraArgs) 633 634 # process and activate input settings 634 635 settings = self._process_inputs(kwds) … … 642 643 if self._handle_sigint: signal.signal(signal.SIGINT, self.signal_handler) 643 644 644 645 645 ## decorate cost function with bounds, penalties, monitors, etc 646 #self._RegisterObjective(cost, ExtraArgs) #XXX: SetObjective ? 646 647 # register termination function 647 648 if termination is not None: … … 649 650 650 651 # the initital optimization iteration 651 self.Step() 652 if callback is not None: 653 callback(self.bestSolution) 652 if not len(self._stepmon): # do generation = 0 653 self.Step() 654 if callback is not None: 655 callback(self.bestSolution) 654 656 655 # initialize termination conditions, if needed656 self._termination(self)657 # initialize termination conditions, if needed 658 self._termination(self) #XXX: call at generation 0 or always? 657 659 # impose the evaluation limits 658 660 self._SetEvaluationLimits() -
mystic/mystic/differential_evolution.py
r683 r698 264 264 return settings 265 265 266 def Solve(self, cost , termination=None, sigint_callback=None,267 ExtraArgs=(), **kwds):266 def Solve(self, cost=None, termination=None, sigint_callback=None, 267 ExtraArgs=None, **kwds): 268 268 """Minimize a function using differential evolution. 269 269 … … 411 411 return settings 412 412 413 def Solve(self, cost , termination=None, sigint_callback=None,414 ExtraArgs=(), **kwds):413 def Solve(self, cost=None, termination=None, sigint_callback=None, 414 ExtraArgs=None, **kwds): 415 415 """Minimize a function using differential evolution. 416 416 -
mystic/mystic/nested.py
r680 r698 53 53 # return 54 54 55 #FIXME: should take cost=None, ExtraArgs=None... and utilize Step 55 56 def Solve(self, cost, termination=None, sigint_callback=None, 56 57 ExtraArgs=(), **kwds): -
mystic/mystic/scipy_optimize.py
r696 r698 255 255 return settings 256 256 257 def Solve(self, cost , termination=None, sigint_callback=None,258 ExtraArgs=(), **kwds):257 def Solve(self, cost=None, termination=None, sigint_callback=None, 258 ExtraArgs=None, **kwds): 259 259 """Minimize a function using the downhill simplex algorithm. 260 260 … … 569 569 return settings 570 570 571 def Solve(self, cost , termination=None, sigint_callback=None,572 ExtraArgs=(), **kwds):571 def Solve(self, cost=None, termination=None, sigint_callback=None, 572 ExtraArgs=None, **kwds): 573 573 """Minimize a function using modified Powell's method. 574 574
Note: See TracChangeset
for help on using the changeset viewer.