    def __init__(self, cost_function, solution_dim, plan_n_segs, max_iters, population_size, num_elites,
                 upper_bound=None, lower_bound=None, epsilon=0.05):
        """
        :param cost_function: Takes input one or multiple data points in R^{sol_dim}\
        :param solution_dim: The dimensionality of the problem space
        :param max_iters: The maximum number of iterations to perform during optimization
        :param population_size: The number of candidate solutions to be sampled at every iteration
        :param num_elites: The number of top solutions that will be used to obtain the distribution
                            at the next iteration.
        :param upper_bound: An array of upper bounds for the sampled data points
        :param lower_bound: An array of lower bounds for the sampled data points
        :param epsilon: A minimum variance. If the maximum variance drops below epsilon, optimization is stopped.
        """
        super().__init__()
        self.solution_dim, self.max_iters, self.population_size, self.num_elites = \
            solution_dim, max_iters, population_size, num_elites
        self.plan_n_segs = plan_n_segs

        self.ub, self.lb = upper_bound.reshape([1, solution_dim]), lower_bound.reshape([1, solution_dim])
        self.epsilon = epsilon

        if num_elites > population_size:
            raise ValueError("Number of elites must be at most the population size.")

        self.cost_function = cost_function
:param cost_function: Takes input one or multiple data points in R^{sol_dim}\
:param solution_dim: The dimensionality of the problem space
:param max_iters: The maximum number of iterations to perform during optimization
:param population_size: The number of candidate solutions to be sampled at every iteration
:param num_elites: The number of top solutions that will be used to obtain the distribution
at the next iteration.
:param upper_bound: An array of upper bounds for the sampled data points
:param lower_bound: An array of lower bounds for the sampled data points
:param epsilon: A minimum variance. If the maximum variance drops below epsilon, optimization is stopped.
execute_locomotion.py