def test01(terminate, func=lambda x: x[0], info=False, debug=False): from mystic.solvers import DifferentialEvolutionSolver2 as DE2 solver = DE2(3, 5) solver.SetRandomInitialPoints() solver.SetEvaluationLimits(8) solver.Solve(func, VTR()) if debug: verbosity(solver) return terminate(solver, info)
def test02(terminate, func=lambda x: x[0], info=False, debug=False): from mystic.solvers import DifferentialEvolutionSolver2 as DE2 #solver = DE2(3,1) #Solver throws ValueError "sample larger than population" #solver = DE2(1,1) #Solver throws ValueError "sample larger than population" solver = DE2(1, 5) solver.SetRandomInitialPoints() solver.SetEvaluationLimits(8) solver.Solve(func, VTR()) if debug: verbosity(solver) return terminate(solver, info)