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 collapse conditions
  
  Args:
      disp (bool, default=False): print details about the solver state at collapse
      info (bool, default=False): return collapsed state (instead of boolean)
      all (bool, default=None): check results for all solvers
  
  Returns:
      information about the state of the solver collapse (see Notes)
  
  Notes:
      - ``all`` can be one of ``{True, False, all, any}``
      - if ``all`` is True, check if all solvers have collapsed
      - if ``all`` is any (or None), check if any solver has collapsed
      - if ``all`` is all, check if all solvers have the same collapse
      - if ``all`` is False, check if the 'best' solver collapsed
      - if ``info`` is False, return a bool regarding the collapse
      - if ``info`` is True, return an informative string about the collapse,
        or a list of strings (depending on the value of ``all``)
docstr_tok: ["check","if","the","solver","meets","the","given","collapse","conditions","Args",":","disp","(","bool",",","default=False",")",":","print","details","about","the","solver","state","at","collapse","info","(","bool",",","default=False",")",":","return","collapsed","state","(","instead","of","boolean",")","all","(","bool",",","default=None",")",":","check","results","for","all","solvers","Returns",":","information","about","the","state","of","the","solver","collapse","(","see","Notes",")","Notes",":","-","``","all","``","can","be","one","of","``","{","True",",","False",",","all",",","any","}","``","-","if","``","all","``","is","True",",","check","if","all","solvers","have","collapsed","-","if","``","all","``","is","any","(","or","None",")",",","check","if","any","solver","has","collapsed","-","if","``","all","``","is","all",",","check","if","all","solvers","have","the","same","collapse","-","if","``","all","``","is","False",",","check","if","the","'best","'","solver","collapsed","-","if","``","info","``","is","False",",","return","a","bool","regarding","the","collapse","-","if","``","info","``","is","True",",","return","an","informative","string","about","the","collapse",",","or","a","list","of","strings","(","depending","on","the","value","of","``","all","``",")"]
code: def Collapsed(self, disp=False, info=False, all=None):
      """check if the solver meets the given collapse conditions
  
      Args:
          disp (bool, default=False): print details about the solver state at collapse
          info (bool, default=False): return collapsed state (instead of boolean)
          all (bool, default=None): check results for all solvers
  
      Returns:
          information about the state of the solver collapse (see Notes)
  
      Notes:
          - ``all`` can be one of ``{True, False, all, any}``
          - if ``all`` is True, check if all solvers have collapsed
          - if ``all`` is any (or None), check if any solver has collapsed
          - if ``all`` is all, check if all solvers have the same collapse
          - if ``all`` is False, check if the 'best' solver collapsed
          - if ``info`` is False, return a bool regarding the collapse
          - if ``info`` is True, return an informative string about the collapse,
            or a list of strings (depending on the value of ``all``)"""  # FIXME: how handle collapse of base solver, mask of base solver...?
      _all = __builtins__["all"]
      if all is None:
          all = any  # FIXME: what should default be???
      elif all not in (
          any,
          _all,
          True,
          False,
      ):  # may be np.all or np.any
          name = getattr(all, "__name__", "")
          if name == "any":
              all = any
          elif name == "all":
              all = _all
      if disp in ["verbose", "all"]:
          verbose = True
      else:
          verbose = False
      no = {} if info else False
      if all is True:  # check for 'all' collapses
          end = [
              no if s is None else s.Collapsed(verbose, info)
              for s in self._allSolvers
          ]
          return end
      elif all is any:  # check for 'any' collapse
          end = {}
          for s in self._allSolvers:
              if s is None:
                  continue
              s = s.Collapsed(disp, info=True)
              if not s:
                  continue
              for k, v in s.items():
                  r = end.get(k, None)
                  if r is not None:
                      if k.startswith(("CollapseCost", "CollapseGrad")):
                          from mystic.tools import interval_overlap
  
                          v = interval_overlap(v, r, union=False)
                      elif k.startswith(
                          ("CollapsePosition", "CollapseWeight")
                      ):
                          from mystic.tools import indicator_overlap
  
                          v = indicator_overlap(v, r, union=False)
                      else:  # CollapseAt, CollapseAs
                          v = v.union(r)
                  end[k] = v
                  if not end[k]:
                      del end[k]
          # NOTE: ignores prior collapses in 'mask'
          return end if info else bool(end)
      elif all is _all:  # check for the same collapse
          terminate = (
              []
          )  # get collapses/terminate for all active solvers
          collapses = [
              s.Collapsed(disp, info=True)
              for s in self._allSolvers
              if s is not None and not terminate.append(s._termination)
          ]
          if not any(collapses):
              return {} if info else False
          from mystic.tools import masked_collapse, no_mask, _no_mask
  
          xlt = {}  # dict of {masked: non-masked}
          for i in terminate:  # xlt has all prior collapses
              xlt.update(no_mask(i))
          end = {}  # dict of {non-masked: collapse}
          for i, s in enumerate(
              collapses
          ):  # XXX: check: overlap of new & old
              s = masked_collapse(terminate[i], s, union=False)
              if not s:
                  end.clear()
                  break
              for k, v in s.items():
                  # get non-masked from masked
                  x = xlt.setdefault(k, _no_mask(k))
                  r = end.get(x, None)  # get value from non-masked
                  if r is not None:
                      if k.startswith(("CollapseCost", "CollapseGrad")):
                          from mystic.tools import interval_overlap
  
                          v = interval_overlap(v, r, union=True)
                      elif k.startswith(
                          ("CollapsePosition", "CollapseWeight")
                      ):
                          from mystic.tools import indicator_overlap
  
                          v = indicator_overlap(v, r, union=True)
                      else:  # CollapseAt, CollapseAs
                          v = v.intersection(r)
                  end[x] = v
                  if not end[x] or not x:
                      del end[x]
          _end = {}  # dict of {masked: collapse}
          for k, x in xlt.items():
              x = end.get(x, None)
              if x is None:
                  continue
              _end[k] = x
          return _end if info else bool(_end)
      self._AbstractEnsembleSolver__update_state()
      if self._bestSolver:
          return self._bestSolver.Collapsed(disp, info)
      return super(AbstractEnsembleSolver, self).Collapsed(disp, info)
  
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 23 for calling the AbstractEnsembleSolver obj's underlying member method code with example usage: obj.Collapsed(disp, info, all) and returns: super, end, self, unknown, unknown, unknown