code: def _check_stop(self, iters, elapsed_time, converged):
          
  
          r_c = self.config['resources']
          
          stop = False
          if converged==0:
              stop=True
          if r_c['maximum-iterations'] !='NA' and iters>= r_c['maximum-iterations']:
              stop = True
          if r_c['max-run-time'] != 'NA' and elapsed_time/60.>= r_c['max-run-time']:
              stop = True
          return stop
docs: Defines the stopping criterion.