class_docstr: AbstractEnsembleSolver base class for mystic optimizers that are called within
  a parallel map.  This allows pseudo-global coverage of parameter space using
  non-global optimizers.
      
class_docstr_tok: ["AbstractEnsembleSolver","base","class","for","mystic","optimizers","that","are","called","within","a","parallel","map",".","This","allows","pseudo-global","coverage","of","parameter","space","using","non-global","optimizers","."]
docstr: check if the solver meets the given termination conditions
  
  Args:
      disp (bool, default=False): print termination statistics and/or warnings
      info (bool, default=False): return termination message (instead of boolean)
      termination (termination, default=None): termination conditions to check
      all (bool, default=None): check results for all solvers
  
  Returns:
      information about the state of the solver termination (see Notes)
  
  Notes:
      - ``all`` can be one of ``{True, False, None}``
      - if ``all`` is True, return a list checking termination for each solver
      - if ``all`` is None, check whether all solvers have terminated
      - if ``all`` is False, check if the 'best' solver terminated
      - if ``info`` is False, return a bool regarding the termination
      - if ``info`` is True, return an informative string about the termination,
        or a list of strings (depending on the value of ``all``)
      - if ``termination`` is None, the solver's stored termination is be used
          
docstr_tok: ["check","if","the","solver","meets","the","given","termination","conditions","Args",":","disp","(","bool",",","default=False",")",":","print","termination","statistics","and\/or","warnings","info","(","bool",",","default=False",")",":","return","termination","message","(","instead","of","boolean",")","termination","(","termination",",","default=None",")",":","termination","conditions","to","check","all","(","bool",",","default=None",")",":","check","results","for","all","solvers","Returns",":","information","about","the","state","of","the","solver","termination","(","see","Notes",")","Notes",":","-","``","all","``","can","be","one","of","``","{","True",",","False",",","None","}","``","-","if","``","all","``","is","True",",","return","a","list","checking","termination","for","each","solver","-","if","``","all","``","is","None",",","check","whether","all","solvers","have","terminated","-","if","``","all","``","is","False",",","check","if","the","'best","'","solver","terminated","-","if","``","info","``","is","False",",","return","a","bool","regarding","the","termination","-","if","``","info","``","is","True",",","return","an","informative","string","about","the","termination",",","or","a","list","of","strings","(","depending","on","the","value","of","``","all","``",")","-","if","``","termination","``","is","None",",","the","solver","'s","stored","termination","is","be","used"]
code: def Terminated(
      self, disp=False, info=False, termination=None, all=None
  ):
      """check if the solver meets the given termination conditions
  
      Args:
          disp (bool, default=False): print termination statistics and/or warnings
          info (bool, default=False): return termination message (instead of boolean)
          termination (termination, default=None): termination conditions to check
          all (bool, default=None): check results for all solvers
  
      Returns:
          information about the state of the solver termination (see Notes)
  
      Notes:
          - ``all`` can be one of ``{True, False, None}``
          - if ``all`` is True, return a list checking termination for each solver
          - if ``all`` is None, check whether all solvers have terminated
          - if ``all`` is False, check if the 'best' solver terminated
          - if ``info`` is False, return a bool regarding the termination
          - if ``info`` is True, return an informative string about the termination,
            or a list of strings (depending on the value of ``all``)
          - if ``termination`` is None, the solver's stored termination is be used
      """
      if disp in ["verbose", "all"]:
          verbose = True
      else:
          verbose = False
      no = "" if info else False
      if all is True:
          end = [
              no
              if s is None
              else s.Terminated(verbose, info, termination)
              for s in self._allSolvers
          ]
          return end
      elif all is None:
          end = [
              False
              if s is None
              else s.Terminated(termination=termination)
              for s in self._allSolvers
          ]
          if False in end:
              return no
          # else: get info from bestSolver
      self._AbstractEnsembleSolver__update_state()
      solver = self._bestSolver or self
      if termination is None:
          termination = solver._termination
      # ensure evaluation limits have been imposed
      self._SetEvaluationLimits()  # XXX: always?
      # check for termination messages
      msg = termination(solver, info=True)
      sig = "SolverInterrupt with %s" % {}
      lim = "EvaluationLimits with %s" % {
          "evaluations": solver._maxfun,
          "generations": solver._maxiter,
      }
  
      # push solver internals to scipy.optimize.fmin interface
      if (
          solver._fcalls[0] >= solver._maxfun
          and solver._maxfun is not None
      ):
          msg = lim  # XXX: prefer the default stop ?
          if disp:
              print(
                  "Warning: Maximum number of function evaluations has "
                  "been exceeded."
              )
      elif (
          solver.generations >= solver._maxiter
          and solver._maxiter is not None
      ):
          msg = lim  # XXX: prefer the default stop ?
          if disp:
              print(
                  "Warning: Maximum number of iterations has been exceeded"
              )
      elif solver._EARLYEXIT:  # XXX: self or solver ?
          msg = sig
          if disp:
              print(
                  "Warning: Optimization terminated with signal interrupt."
              )
      elif msg and disp:
          print("Optimization terminated successfully.")
          print(
              "         Current function value: %s" % solver.bestEnergy
          )
          print("         Iterations: %d" % solver.generations)
          print("         Function evaluations: %d" % solver._fcalls[0])
          print(
              "         Total function evaluations: %d"
              % self._total_evals
          )
  
      if info:
          return msg
      return bool(msg)
  
imports: from mystic.monitors import Null
  from mystic.abstract_map_solver import AbstractMapSolver
  from mystic.tools import wrap_function
  from functools import reduce
label_desc: Use image node_id 14 for calling the AbstractEnsembleSolver obj's underlying member method code with example usage: obj.Terminated(disp, info, termination, all) and returns: bool, end, msg, no