class_docstr: Differential Evolution optimization, using Storn and Price's algorithm.
  
  Alternate implementation: 
      - utilizes a map-reduce interface, extensible to parallel computing
      - both a current and a next generation are kept, while the current
        generation is invariant during the main DE logic
      
class_docstr_tok: ["Differential","Evolution","optimization",",","using","Storn","and","Price","'s","algorithm",".","Alternate","implementation",":","-","utilizes","a","map-reduce","interface",",","extensible","to","parallel","computing","-","both","a","current","and","a","next","generation","are","kept",",","while","the","current","generation","is","invariant","during","the","main","DE","logic"]
docstr: Args: 
      dim (int): dimensionality of the problem
      NP (int, default=4): size of the trial solution population, with ``NP >= 4``
          
docstr_tok: ["Args",":","dim","(","int",")",":","dimensionality","of","the","problem","NP","(","int",",","default=4",")",":","size","of","the","trial","solution","population",",","with","``","NP",">","=","4","``"]
code: def __init__(self, dim, NP=4):
      """
      Args:
          dim (int): dimensionality of the problem
          NP (int, default=4): size of the trial solution population, with ``NP >= 4``
      """
      # All important class members are inherited from AbstractSolver.
      NP = max(NP, dim, 4)  # XXX: raise Error if npop <= 4?
      super(DifferentialEvolutionSolver2, self).__init__(dim, npop=NP)
      self.genealogy = [[] for j in range(NP)]
      self.scale = 0.8
      self.probability = 0.9
      self.strategy = "Best1Bin"
      ftol = 5e-3
      from mystic.termination import VTRChangeOverGeneration
  
      self._termination = VTRChangeOverGeneration(ftol)
  
imports: from mystic.tools import wrap_function, unpair, isiterable
  from mystic.tools import wrap_bounds, wrap_penalty, reduced
  from mystic.abstract_solver import AbstractSolver
  from mystic.abstract_map_solver import AbstractMapSolver
  from numpy import asfarray, ravel
  from collections.abc import Callable
label_desc: Use image node_id 1 to create a new DifferentialEvolutionSolver2 object from inherited base classes: AbstractMapSolver with example: obj = DifferentialEvolutionSolver2(dim, NP)