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: Takes one initial input::
  
      dim      -- dimensionality of the problem.
  
  Additional inputs::
  
      npop     -- size of the trial solution population.      [default = 1]
      nbins    -- tuple of number of bins in each dimension.  [default = [1]*dim]
      npts     -- number of solver instances.                 [default = 1]
      rtol     -- size of radial tolerance for sparsity.      [default = None]
  
  Important class members::
  
      nDim, nPop       = dim, npop
      generations      - an iteration counter.
      evaluations      - an evaluation counter.
      bestEnergy       - current best energy.
      bestSolution     - current best parameter set.           [size = dim]
      popEnergy        - set of all trial energy solutions.    [size = npop]
      population       - set of all trial parameter solutions. [size = dim*npop]
      solution_history - history of bestSolution status.       [StepMonitor.x]
      energy_history   - history of bestEnergy status.         [StepMonitor.y]
      signal_handler   - catches the interrupt signal.         [***disabled***]
          
docstr_tok: ["Takes","one","initial","input",":",":","dim","--","dimensionality","of","the","problem",".","Additional","inputs",":",":","npop","--","size","of","the","trial","solution","population",".","[","default","=","1","]","nbins","--","tuple","of","number","of","bins","in","each","dimension",".","[","default","=","[","1","]","*","dim","]","npts","--","number","of","solver","instances",".","[","default","=","1","]","rtol","--","size","of","radial","tolerance","for","sparsity",".","[","default","=","None","]","Important","class","members",":",":","nDim",",","nPop","=","dim",",","npop","generations","-","an","iteration","counter",".","evaluations","-","an","evaluation","counter",".","bestEnergy","-","current","best","energy",".","bestSolution","-","current","best","parameter","set",".","[","size","=","dim","]","popEnergy","-","set","of","all","trial","energy","solutions",".","[","size","=","npop","]","population","-","set","of","all","trial","parameter","solutions",".","[","size","=","dim","*","npop","]","solution_history","-","history","of","bestSolution","status",".","[","StepMonitor.x","]","energy_history","-","history","of","bestEnergy","status",".","[","StepMonitor.y","]","signal_handler","-","catches","the","interrupt","signal",".","[","*","*","*","disabled","*","*","*","]"]
code: def __init__(self, dim, **kwds):
      """
      Takes one initial input::
  
          dim      -- dimensionality of the problem.
  
      Additional inputs::
  
          npop     -- size of the trial solution population.      [default = 1]
          nbins    -- tuple of number of bins in each dimension.  [default = [1]*dim]
          npts     -- number of solver instances.                 [default = 1]
          rtol     -- size of radial tolerance for sparsity.      [default = None]
  
      Important class members::
  
          nDim, nPop       = dim, npop
          generations      - an iteration counter.
          evaluations      - an evaluation counter.
          bestEnergy       - current best energy.
          bestSolution     - current best parameter set.           [size = dim]
          popEnergy        - set of all trial energy solutions.    [size = npop]
          population       - set of all trial parameter solutions. [size = dim*npop]
          solution_history - history of bestSolution status.       [StepMonitor.x]
          energy_history   - history of bestEnergy status.         [StepMonitor.y]
          signal_handler   - catches the interrupt signal.         [***disabled***]
      """
      super(AbstractEnsembleSolver, self).__init__(dim, **kwds)
      # self.signal_handler   = None
      # self._handle_sigint   = False
  
      # default settings for nested optimization
      # XXX: move nbins and npts to _InitialPoints?
      self._dist = None  # kwds['dist'] if 'dist' in kwds else None
      npts = kwds["npts"] if "npts" in kwds else 1
      if npts is None:
          npts = 1
      self._npts = npts
      nbins = kwds["nbins"] if "nbins" in kwds else None
      self._nbins = nbins
      if isinstance(nbins, int):
          self._npts = nbins
      elif nbins is None:
          pass  # nbins = [1]*dim
      else:
          self._npts = reduce(lambda i, j: i * j, nbins)  # nbins
      rtol = kwds["rtol"] if "rtol" in kwds else None
      self._rtol = rtol
      from mystic.solvers import NelderMeadSimplexSolver
  
      self._solver = NelderMeadSimplexSolver
      self._bestSolver = None  # 'best' solver (after Solve)
      self._allSolvers = [None for j in range(self._npts)]
      self._step = False
      return
  
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 1 to create a new AbstractEnsembleSolver object from inherited base classes: AbstractMapSolver with example: obj = AbstractEnsembleSolver(dim)