'Compute strategy parameters as a function
of dimension and population size'

def set(self, opts, popsize=None, ccovfac=1, verbose=True):

    alpha_cc = 1.0
    def cone(df, mu, N, alphacov=2.0):
        'rank    one    update    learning    rate,    ``df``    is    disregarded    and    obsolete,    reduce    alphacov    on    noisy    problems,    say    to    0.5'
        return (alphacov / (((N + 1.3) ** 2) + mu))
    def cmu(df, mu, alphamu=0.0, alphacov=2.0):
        'rank    mu    learning    rate,    disregarding    the    constrant    cmu    <=    1    -    cone'
        c = ((alphacov * (((alphamu + mu) - 2) + (1 / mu))) / (((N + 2) ** 2) + ((alphacov * mu) / 2)))
        return c
    def conedf(df, mu, N):
        'used    for    computing    separable    learning    rate'
        return (1.0 / ((df + (2.0 * sqrt(df))) + (float(mu) / N)))
    def cmudf(df, mu, alphamu):
        'used    for    computing    separable    learning    rate'
        return ((((alphamu + mu) - 2.0) + (1.0 / mu)) / ((df + (4.0 * sqrt(df))) + (mu / 2.0)))
    sp = self
    N = sp.N
    if popsize:
        opts.evalall({'N': N, 'popsize': popsize})
    else:
        popsize = opts.evalall({'N': N})['popsize']
    sp.popsize = popsize
    if (opts['CMA_mirrors'] < 0.5):
        sp.lam_mirr = int((0.5 + (opts['CMA_mirrors'] * popsize)))
    elif (opts['CMA_mirrors'] > 1):
        sp.lam_mirr = int((0.5 + opts['CMA_mirrors']))
    else:
        sp.lam_mirr = int(((0.5 + (0.16 * min((popsize, ((2 * N) + 2))))) + 0.29))
    sp.mu_f = (sp.popsize / 2.0)
    if (opts['CMA_mu'] is not None):
        sp.mu_f = opts['CMA_mu']
    sp.mu = int((sp.mu_f + 0.499999))
    if (sp.mu > ((sp.popsize - (2 * sp.lam_mirr)) + 1)):
        print(('WARNING:    pairwise    selection    is    not    implemented,    therefore    ' + ('    mu    =    %d    >    %d    =    %d    -    2*%d    +    1    =    popsize    -    2*mirr    +    1    can    produce    a    bias' % (sp.mu, ((sp.popsize - (2 * sp.lam_mirr)) + 1), sp.popsize, sp.lam_mirr))))
    if (sp.lam_mirr > (sp.popsize // 2)):
        raise _Error(('fraction    of    mirrors    in    the    population    as    read    from    option    CMA_mirrors    cannot    be    larger    0.5,    ' + 'theoretically    optimal    is    0.159'))
    sp.weights = (log((max([sp.mu, (sp.popsize / 2.0)]) + 0.5)) - log((1 + np.arange(sp.mu))))
    if (11 < 3):
        sp.mu = (sp.popsize // 4)
        sp.weights = np.ones(sp.mu)
        print(sp.weights[:10])
    sp.weights /= sum(sp.weights)
    sp.mueff = (1 / sum((sp.weights ** 2)))
    sp.cs = ((sp.mueff + 2) / ((N + sp.mueff) + 3))
    sp.dampsvec = ((opts['CMA_dampsvec_fac'] * (N + 2)) if opts['CMA_dampsvec_fac'] else np.Inf)
    sp.dampsvec_fading = opts['CMA_dampsvec_fade']
    if np.isfinite(sp.dampsvec):
        sp.cs = (((sp.mueff + 2) / ((N + sp.mueff) + 3)) ** 0.5)
    sp.cc = ((4 + ((alpha_cc * sp.mueff) / N)) / ((N + 4) + (((alpha_cc * 2) * sp.mueff) / N)))
    sp.cc_sep = (((1 + (1 / N)) + ((alpha_cc * sp.mueff) / N)) / (((N ** 0.5) + (1 / N)) + (((alpha_cc * 2) * sp.mueff) / N)))
    sp.rankmualpha = opts['CMA_rankmualpha']
    sp.c1 = ((ccovfac * min(1, (sp.popsize / 6))) * cone((((N ** 2) + N) / 2), sp.mueff, N))
    sp.c1_sep = (ccovfac * conedf(N, sp.mueff, N))
    if (11 < 3):
        sp.c1 = 0.0
        print('c1    is    zero')
    if (opts['CMA_rankmu'] != 0):
        sp.cmu = min((1 - sp.c1), (ccovfac * cmu((((N ** 2) + N) / 2), sp.mueff, sp.rankmualpha)))
        sp.cmu_sep = min((1 - sp.c1_sep), (ccovfac * cmudf(N, sp.mueff, sp.rankmualpha)))
    else:
        sp.cmu = sp.cmu_sep = 0
    sp.neg = BlancClass()
    if opts['CMA_active']:
        sp.neg.mu_f = ((popsize - ((popsize + sp.lam_mirr) / 2)) if (popsize > 2) else 1)
        sp.neg.weights = (log((sp.mu_f + 0.5)) - log((1 + np.arange((sp.popsize - int(sp.neg.mu_f)), sp.popsize))))
        sp.neg.mu = len(sp.neg.weights)
        sp.neg.weights /= sum(sp.neg.weights)
        sp.neg.mueff = (1 / sum((sp.neg.weights ** 2)))
        sp.neg.cmuexp = (((opts['CMA_activefac'] * 0.25) * sp.neg.mueff) / (((N + 2) ** 1.5) + (2 * sp.neg.mueff)))
        assert (sp.neg.mu >= sp.lam_mirr)
    else:
        sp.neg.cmuexp = 0
    sp.CMA_on = ((sp.c1 + sp.cmu) > 0)
    if ((not opts['CMA_on']) and (opts['CMA_on'] not in (None, [], (), ''))):
        sp.CMA_on = False
    sp.damps = (opts['CMA_dampfac'] * (((0.5 + (0.5 * (min([1, (((sp.lam_mirr / (0.159 * sp.popsize)) - 1) ** 2)]) ** 1))) + (2 * max([0, ((((sp.mueff - 1) / (N + 1)) ** 0.5) - 1)]))) + sp.cs))
    if (11 < 3):
        sp.damps = ((0.3 + (2 * max([(sp.mueff / sp.popsize), ((((sp.mueff - 1) / (N + 1)) ** 0.5) - 1)]))) + sp.cs)
    if (11 < 3):
        sp.damps = (((((opts['CMA_dampfac'] * (2 - ((0 * sp.lam_mirr) / sp.popsize))) * sp.mueff) / sp.popsize) + 0.3) + sp.cs)
        print('damps    =', sp.damps)
    if (11 < 3):
        sp.damps = (10 * sp.damps)
        print(('damps    is    %f' % sp.damps))
    sp.cmean = float(opts['CMA_cmean'])
    if (sp.cmean != 1):
        print(('        cmean    =    %f' % sp.cmean))
    if verbose:
        if (not sp.CMA_on):
            print('covariance    matrix    adaptation    turned    off')
        if (opts['CMA_mu'] != None):
            print(('mu    =    %f' % sp.mu_f))
