class_docstr: A strategy that will keep track of the basic parameters of the CMA-ES
  algorithm ([Hansen2001]_).
  
  :param centroid: An iterable object that indicates where to start the
                   evolution.
  :param sigma: The initial standard deviation of the distribution.
  :param parameter: One or more parameter to pass to the strategy as
                    described in the following table, optional.
  
  +----------------+---------------------------+----------------------------+
  | Parameter      | Default                   | Details                    |
  +================+===========================+============================+
  | ``lambda_``    | ``int(4 + 3 * log(N))``   | Number of children to      |
  |                |                           | produce at each generation,|
  |                |                           | ``N`` is the individual's  |
  |                |                           | size (integer).            |
  +----------------+---------------------------+----------------------------+
  | ``mu``         | ``int(lambda_ / 2)``      | The number of parents to   |
  |                |                           | keep from the              |
  |                |                           | lambda children (integer). |
  +----------------+---------------------------+----------------------------+
  | ``cmatrix``    | ``identity(N)``           | The initial covariance     |
  |                |                           | matrix of the distribution |
  |                |                           | that will be sampled.      |
  +----------------+---------------------------+----------------------------+
  | ``weights``    | ``"superlinear"``         | Decrease speed, can be     |
  |                |                           | ``"superlinear"``,         |
  |                |                           | ``"linear"`` or            |
  |                |                           | ``"equal"``.               |
  +----------------+---------------------------+----------------------------+
  | ``cs``         | ``(mueff + 2) /           | Cumulation constant for    |
  |                | (N + mueff + 3)``         | step-size.                 |
  +----------------+---------------------------+----------------------------+
  | ``damps``      | ``1 + 2 * max(0, sqrt((   | Damping for step-size.     |
  |                | mueff - 1) / (N + 1)) - 1)|                            |
  |                | + cs``                    |                            |
  +----------------+---------------------------+----------------------------+
  | ``ccum``       | ``4 / (N + 4)``           | Cumulation constant for    |
  |                |                           | covariance matrix.         |
  +----------------+---------------------------+----------------------------+
  | ``ccov1``      | ``2 / ((N + 1.3)^2 +      | Learning rate for rank-one |
  |                | mueff)``                  | update.                    |
  +----------------+---------------------------+----------------------------+
  | ``ccovmu``     | ``2 * (mueff - 2 + 1 /    | Learning rate for rank-mu  |
  |                | mueff) / ((N + 2)^2 +     | update.                    |
  |                | mueff)``                  |                            |
  +----------------+---------------------------+----------------------------+
  
  .. [Hansen2001] Hansen and Ostermeier, 2001. Completely Derandomized
     Self-Adaptation in Evolution Strategies. *Evolutionary Computation*
class_docstr_tok: ["A","strategy","that","will","keep","track","of","the","basic","parameters","of","the","CMA-ES","algorithm","(","[","Hansen2001","]","_",")",".",":","param","centroid",":","An","iterable","object","that","indicates","where","to","start","the","evolution",".",":","param","sigma",":","The","initial","standard","deviation","of","the","distribution",".",":","param","parameter",":","One","or","more","parameter","to","pass","to","the","strategy","as","described","in","the","following","table",",","optional",".","+","--","--","--","--","--","--","--","--","+","--","--","--","--","--","--","--","--","--","--","--","--","--","-+","--","--","--","--","--","--","--","--","--","--","--","--","--","--","+","|","Parameter","|","Default","|","Details","|","+================+===========================+============================+","|","``","lambda_","``","|","``","int","(","4","+","3","*","log","(","N",")",")","``","|","Number","of","children","to","|","|","|","|","produce","at","each","generation",",","|","|","|","|","``","N","``","is","the","individual","'s","|","|","|","|","size","(","integer",")",".","|","+","--","--","--","--","--","--","--","--","+","--","--","--","--","--","--","--","--","--","--","--","--","--","-+","--","--","--","--","--","--","--","--","--","--","--","--","--","--","+","|","``","mu","``","|","``","int","(","lambda_","\/","2",")","``","|","The","number","of","parents","to","|","|","|","|","keep","from","the","|","|","|","|","lambda","children","(","integer",")",".","|","+","--","--","--","--","--","--","--","--","+","--","--","--","--","--","--","--","--","--","--","--","--","--","-+","--","--","--","--","--","--","--","--","--","--","--","--","--","--","+","|","``","cmatrix","``","|","``","identity","(","N",")","``","|","The","initial","covariance","|","|","|","|","matrix","of","the","distribution","|","|","|","|","that","will","be","sampled",".","|","+","--","--","--","--","--","--","--","--","+","--","--","--","--","--","--","--","--","--","--","--","--","--","-+","--","--","--","--","--","--","--","--","--","--","--","--","--","--","+","|","``","weights","``","|","``","``","superlinear","''","``","|","Decrease","speed",",","can","be","|","|","|","|","``","``","superlinear","''","``",",","|","|","|","|","``","``","linear","''","``","or","|","|","|","|","``","``","equal","''","``",".","|","+","--","--","--","--","--","--","--","--","+","--","--","--","--","--","--","--","--","--","--","--","--","--","-+","--","--","--","--","--","--","--","--","--","--","--","--","--","--","+","|","``","cs","``","|","``","(","mueff","+","2",")","\/","|","Cumulation","constant","for","|","|","|","(","N","+","mueff","+","3",")","``","|","step-size",".","|","+","--","--","--","--","--","--","--","--","+","--","--","--","--","--","--","--","--","--","--","--","--","--","-+","--","--","--","--","--","--","--","--","--","--","--","--","--","--","+","|","``","damps","``","|","``","1","+","2","*","max","(","0",",","sqrt","(","(","|","Damping","for","step-size",".","|","|","|","mueff","-","1",")","\/","(","N","+","1",")",")","-","1",")","|","|","|","|","+","cs","``","|","|","+","--","--","--","--","--","--","--","--","+","--","--","--","--","--","--","--","--","--","--","--","--","--","-+","--","--","--","--","--","--","--","--","--","--","--","--","--","--","+","|","``","ccum","``","|","``","4","\/","(","N","+","4",")","``","|","Cumulation","constant","for","|","|","|","|","covariance","matrix",".","|","+","--","--","--","--","--","--","--","--","+","--","--","--","--","--","--","--","--","--","--","--","--","--","-+","--","--","--","--","--","--","--","--","--","--","--","--","--","--","+","|","``","ccov1","``","|","``","2","\/","(","(","N","+","1.3",")","^2","+","|","Learning","rate","for","rank-one","|","|","|","mueff",")","``","|","update",".","|","+","--","--","--","--","--","--","--","--","+","--","--","--","--","--","--","--","--","--","--","--","--","--","-+","--","--","--","--","--","--","--","--","--","--","--","--","--","--","+","|","``","ccovmu","``","|","``","2","*","(","mueff","-","2","+","1","\/","|","Learning","rate","for","rank-mu","|","|","|","mueff",")","\/","(","(","N","+","2",")","^2","+","|","update",".","|","|","|","mueff",")","``","|","|","+","--","--","--","--","--","--","--","--","+","--","--","--","--","--","--","--","--","--","--","--","--","--","-+","--","--","--","--","--","--","--","--","--","--","--","--","--","--","+","..","[","Hansen2001","]","Hansen","and","Ostermeier",",","2001",".","Completely","Derandomized","Self-Adaptation","in","Evolution","Strategies",".","*","Evolutionary","Computation","*"]
docstr: Computes the parameters depending on :math:`\lambda`. It needs to
  be called again if :math:`\lambda` changes during evolution.
  
  :param params: A dictionary of the manually set parameters.
docstr_tok: ["Computes","the","parameters","depending","on",":","math",":","`","\\lambda","`",".","It","needs","to","be","called","again","if",":","math",":","`","\\lambda","`","changes","during","evolution",".",":","param","params",":","A","dictionary","of","the","manually","set","parameters","."]
code: def computeParams(self, params):
      r"""Computes the parameters depending on :math:`\lambda`. It needs to
      be called again if :math:`\lambda` changes during evolution.
  
      :param params: A dictionary of the manually set parameters.
      """
      self.mu = params.get("mu", int(self.lambda_ / 2))
      rweights = params.get("weights", "superlinear")
      if rweights == "superlinear":
          self.weights = log(self.mu + 0.5) - numpy.log(
              numpy.arange(1, self.mu + 1)
          )
      elif rweights == "linear":
          self.weights = self.mu + 0.5 - numpy.arange(1, self.mu + 1)
      elif rweights == "equal":
          self.weights = numpy.ones(self.mu)
      else:
          raise RuntimeError("Unknown weights : %s" % rweights)
  
      self.weights /= sum(self.weights)
      self.mueff = 1.0 / sum(self.weights**2)
  
      self.cc = params.get("ccum", 4.0 / (self.dim + 4.0))
      self.cs = params.get(
          "cs", (self.mueff + 2.0) / (self.dim + self.mueff + 3.0)
      )
      self.ccov1 = params.get(
          "ccov1", 2.0 / ((self.dim + 1.3) ** 2 + self.mueff)
      )
      self.ccovmu = params.get(
          "ccovmu",
          2.0
          * (self.mueff - 2.0 + 1.0 / self.mueff)
          / ((self.dim + 2.0) ** 2 + self.mueff),
      )
      self.ccovmu = min(1 - self.ccov1, self.ccovmu)
      self.damps = (
          1.0
          + 2.0
          * max(0, sqrt((self.mueff - 1.0) / (self.dim + 1.0)) - 1.0)
          + self.cs
      )
      self.damps = params.get("damps", self.damps)
  
imports: import copy
  from math import sqrt, log, exp
  from itertools import cycle
  import warnings
  import numpy
  from .None import tools
label_desc: Use image node_id 4 for calling the Strategy obj's underlying member method code with example usage: obj.computeParams(params) without return types