def adaptOptimizer(problem, seedProblemParams, seedPrimitive):
    """Return the adaptation optimizer used by the primitive library"""
    #adapt for 100 iterations
    opt = optimize.localOptimizer(problem,
                                  'ddp',
                                  tol=1e-4,
                                  seed=seedPrimitive,
                                  numIters=100)
    return opt
def adaptOptimizer(problem, seedProblemParams, seedPrimitive):
    """Return the adaptation optimizer used by the primitive library"""
    #100 simulated annealing iterations, 100 perturbation sampling iterations per iteration
    opt = optimize.localOptimizer(problem,
                                  'sa',
                                  radius=0.01,
                                  samplecond=100,
                                  temperature=lambda x: 0.2 / (1.0 + x * 0.1),
                                  seed=seedPrimitive,
                                  numIters=100)
    return opt
def adaptOptimizer(problem,seedProblemParams,seedPrimitive):
    """Return the adaptation optimizer used by the primitive library"""
    opt = optimize.localOptimizer(problem,'gradient',tol=1e-4,x=seedPrimitive,numIters=100)
    opt.beginPrint()
    return opt