def __init__(self, sol_dim, max_iters, popsize, num_elites, cost_function, upper_bound=None, lower_bound=None, epsilon=0.001, alpha=0.25, viz_dir=None):
    'Creates an instance of this class.\n        Arguments:\n            sol_dim (int): The dimensionality of the problem space\n            max_iters (int): The maximum number of iterations to perform during optimization\n            popsize (int): The number of candidate solutions to be sampled at every iteration\n            num_elites (int): The number of top solutions that will be used to obtain the distribution\n                at the next iteration.\n            upper_bound (np.array): An array of upper bounds\n            lower_bound (np.array): An array of lower bounds\n            epsilon (float): A minimum variance. If the maximum variance drops below epsilon, optimization is\n                stopped.\n            alpha (float): Controls how much of the previous mean and variance is used for the next iteration.\n                next_mean = alpha * old_mean + (1 - alpha) * elite_mean, and similarly for variance.\n        '
    super().__init__()
    (self.sol_dim, self.max_iters, self.popsize, self.num_elites) = (sol_dim, max_iters, popsize, num_elites)
    (self.ub, self.lb) = (upper_bound, lower_bound)
    (self.epsilon, self.alpha) = (epsilon, alpha)
    self.cost_function = cost_function
    if (viz_dir is not None):
        self.writer = tensorboardX.SummaryWriter(viz_dir)
    else:
        self.writer = tensorboardX.SummaryWriter()
    if (num_elites > popsize):
        raise ValueError('Number of elites must be at most the population size.')
Creates an instance of this class.
Arguments:
    sol_dim (int): The dimensionality of the problem space
    max_iters (int): The maximum number of iterations to perform during optimization
    popsize (int): The number of candidate solutions to be sampled at every iteration
    num_elites (int): The number of top solutions that will be used to obtain the distribution
        at the next iteration.
    upper_bound (np.array): An array of upper bounds
    lower_bound (np.array): An array of lower bounds
    epsilon (float): A minimum variance. If the maximum variance drops below epsilon, optimization is
        stopped.
    alpha (float): Controls how much of the previous mean and variance is used for the next iteration.
        next_mean = alpha * old_mean + (1 - alpha) * elite_mean, and similarly for variance.
def __init__(self, sol_dim, max_iters, popsize, num_elites, cost_function, upper_bound=None, lower_bound=None, epsilon=0.001, alpha=0.25, viz_dir=None):
    'Creates an instance of this class.\n        Arguments:\n            sol_dim (int): The dimensionality of the problem space\n            max_iters (int): The maximum number of iterations to perform during optimization\n            popsize (int): The number of candidate solutions to be sampled at every iteration\n            num_elites (int): The number of top solutions that will be used to obtain the distribution\n                at the next iteration.\n            upper_bound (np.array): An array of upper bounds\n            lower_bound (np.array): An array of lower bounds\n            epsilon (float): A minimum variance. If the maximum variance drops below epsilon, optimization is\n                stopped.\n            alpha (float): Controls how much of the previous mean and variance is used for the next iteration.\n                next_mean = alpha * old_mean + (1 - alpha) * elite_mean, and similarly for variance.\n        '
    super().__init__()
    (self.sol_dim, self.max_iters, self.popsize, self.num_elites) = (sol_dim, max_iters, popsize, num_elites)
    (self.ub, self.lb) = (upper_bound, lower_bound)
    (self.epsilon, self.alpha) = (epsilon, alpha)
    self.cost_function = cost_function
    if (viz_dir is not None):
        self.writer = tensorboardX.SummaryWriter(viz_dir)
    else:
        self.writer = tensorboardX.SummaryWriter()
    if (num_elites > popsize):
        raise ValueError('Number of elites must be at most the population size.')