Changeset 783


Ignore:
Timestamp:
02/18/15 08:17:08 (15 months ago)
Author:
mmckerns
Message:

fix: add _SetEvaluationLimits to ensemble CheckTermination?;
Step now expects settings at each call in Solve

Location:
mystic/mystic
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • mystic/mystic/abstract_ensemble_solver.py

    r776 r783  
    225225        if termination is None: 
    226226            termination = solver._termination 
    227  
     227        # ensure evaluation limits have been imposed 
     228        self._SetEvaluationLimits() 
    228229        # check for termination messages 
    229230        msg = termination(solver, info=True) 
  • mystic/mystic/abstract_solver.py

    r782 r783  
    718718        # the initital optimization iteration 
    719719        if not len(self._stepmon): # do generation = 0 
    720             self.Step(callback=callback) 
     720            self.Step(**settings)  # includes settings['callback'] 
    721721 
    722722        # the main optimization loop 
  • mystic/mystic/differential_evolution.py

    r782 r783  
    216216        return cost 
    217217 
    218     def Step(self, cost=None, ExtraArgs=None, strategy=None, **kwds): 
     218    def Step(self, cost=None, ExtraArgs=None, **kwds): 
    219219        """perform a single optimization iteration 
    220220        Note that ExtraArgs should be a *tuple* of extra arguments""" 
     
    222222        cost = self._bootstrap_objective(cost, ExtraArgs) 
    223223        # process and activate input settings 
    224         kwds['strategy'] = strategy  # override default strategy 
    225224        settings = self._process_inputs(kwds) 
    226225        for key in settings: 
     
    231230        if not len(self._stepmon): # do generation = 0 
    232231            init = True 
     232            strategy = None 
    233233            self.population[0] = asfarray(self.population[0]) 
    234234            # decouple bestSolution from population and bestEnergy from popEnergy 
     
    381381        return cost 
    382382 
    383     def Step(self, cost=None, ExtraArgs=None, strategy=None, **kwds): 
     383    def Step(self, cost=None, ExtraArgs=None, **kwds): 
    384384        """perform a single optimization iteration 
    385385        Note that ExtraArgs should be a *tuple* of extra arguments""" 
     
    387387        cost = self._bootstrap_objective(cost, ExtraArgs) 
    388388        # process and activate input settings 
    389         kwds['strategy'] = strategy  # override default strategy 
    390389        settings = self._process_inputs(kwds) 
    391390        for key in settings: 
     
    396395        if not len(self._stepmon): # do generation = 0 
    397396            init = True 
     397            strategy = None 
    398398            self.population[0] = asfarray(self.population[0]) 
    399399            # decouple bestSolution from population and bestEnergy from popEnergy 
Note: See TracChangeset for help on using the changeset viewer.