Main function for PSO optimizer example.

    Instantiate PSOOptimizer to optimize 30-dimensional spherical function.

def main(dimension, iterations):
    """ Main function for PSO optimizer example.

    Instantiate PSOOptimizer to optimize 30-dimensional spherical function.
    """
    optimizer = PSOOptimizer()
    solution = optimizer.minimize(sphere, -5.12, 5.12, dimension,
                                  max_iterations(iterations))
    return solution, optimizer