def evaluate_rastrigin(candidates, args):
    fitness = []
    for cs in candidates:
        fit = 10 * len(cs) + sum([(10 * cos(2 * pi * (x - 1)) - (x - 1)**2) for x in cs])
        fitness.append(fit)
    return fitness

#start_main
dataset/ETHPy150Open aarongarrett/inspyred/docs/rastrigin.py/evaluate_rastrigin/swapped operands of `-`