def evaluate(self, x):
        """
        Performs the evaluation of the objective at x.
        """

        if self.n_procs == 1:
            f_evals, cost_evals = self._eval_func(x)
        else:
            try:
                f_evals, cost_evals = self._syncronous_batch_evaluation(x)
            except:
                if not hasattr(self, 'parallel_error'):
                    print('Error in parallel computation. Fall back to single process!')
                else:
                    self.parallel_error = True
                f_evals, cost_evals = self._eval_func(x)

        return f_evals, cost_evals
def evaluate ( self , x ) : if self . n_procs == 1 : f_evals , cost_evals = self . _eval_func ( x ) else : try : f_evals , cost_evals = self . _syncronous_batch_evaluation ( x ) except : if not hasattr ( self , 'parallel_error' ) : print ( 'Error in parallel computation. Fall back to single process!' ) else : self . parallel_error = True f_evals , cost_evals = self . _eval_func ( x ) return f_evals , cost_evals
Performs the evaluation of the objective at x.