for i in range(replications): cipde0B[i].solve() pp.saveExpObject(cipde0B[i], save_path + "cipde0b_rep_" + str(i) + ".json") print(save_path + "cipde0b_rep_" + str(i) + ".json" + " -> saved") ########################## # testbed problem 1 # ########################## cipde1 = [] for i in range(replications): initialPop = np.random.randn(8, 4) mpJadea = oaMempJadeadaptive.OptAlgoMemeticpJADEadaptive( initialPop, max_fe, min_err) cipde1.append(pde1.CiPde1(mpJadea, gakernel, nb1, nc1)) for i in range(replications): cipde1[i].solve() pp.saveExpObject(cipde1[i], save_path + "cipde1_rep_" + str(i) + ".json") print(save_path + "cipde1_rep_" + str(i) + ".json" + " -> saved") ########################## # testbed problem 2 # ########################## cipde2 = [] for i in range(replications): initialPop = np.random.randn(8, 4) mpJadea = oaMempJadeadaptive.OptAlgoMemeticpJADEadaptive( initialPop, max_fe, min_err)
for i in range(replications): obj = parallelResults[i].get() pp.saveExpObject(obj, "../../cipde0b_mj_rep_" + str(i) + ".json") print("../../cipde0b_mj_rep_" + str(i) + ".json" + " -> saved") pool.close() pool.join() #################################### # testbed problem 1 for mJADE # #################################### cipde1 = [] for i in range(replications): initialPop = np.random.randn(40, 20) mJADE = oaMJ.OptAlgoMemeticJADE(initialPop, max_fe, min_err) cipde1.append(pde1.CiPde1(mJADE, gakernel, nb1, nc1)) pool = Pool(processes=20) parallelResults = [] for i in range(replications): parallelResults.append(pool.apply_async(solveObj, args=(cipde1, i))) for i in range(replications): obj = parallelResults[i].get() pp.saveExpObject(obj, "../../cipde1_mj_rep_" + str(i) + ".json") print("../../cipde1_mj_rep_" + str(i) + ".json" + " -> saved") pool.close() pool.join() ####################################
cipde0B.append(pde0B.CiPde0B(mpJADE, gskernel, nb2, nc2)) for i in range(replications): cipde0B[i].solve() pp.saveExpObject(cipde0B[i], "../../cipde0b_mpjgsk_rep_" + str(i) + ".json") print("../../cipde0b_mpjgsk_rep_" + str(i) + ".json" + " -> saved") #################################### # testbed problem 1 for mpJADEa # #################################### cipde1 = [] for i in range(replications): initialPop = np.random.randn(60, 30) mpJADE = oapMJ.OptAlgoMemeticpJADE(initialPop, max_fe, min_err) cipde1.append(pde1.CiPde1(mpJADE, gskernel, nb1, nc1)) for i in range(replications): cipde1[i].solve() pp.saveExpObject(cipde1[i], "../../cipde1_mpjgsk_rep_" + str(i) + ".json") print("../../cipde1_mpjgsk_rep_" + str(i) + ".json" + " -> saved") #################################### # testbed problem 2 for mpJADEa # #################################### cipde2 = [] for i in range(replications): initialPop = np.random.randn(60, 30) mpJADE = oapMJ.OptAlgoMemeticpJADE(initialPop, max_fe, min_err) cipde2.append(pde2.CiPde2(mpJADE, gskernel, nb1, nc1))
for i in range(replications): cipde0B[i].solve() pp.saveExpObject( cipde0B[i], "D:/Nicolai/MA_Data/experiment0/cipde0b_rep_" + str(i) + ".json") print("D:/Nicolai/MA_Data/experiment0/cipde0b_rep_" + str(i) + ".json" + " -> saved") ########################## # testbed problem 1 # ########################## cipde1 = [] for i in range(replications): initialPop = np.random.randn(40, 20) mJade = oaMemJade.OptAlgoMemeticJADE(initialPop, max_fe, min_err) cipde1.append(pde1.CiPde1(mJade, gkernel, nb1, nc1)) for i in range(replications): cipde1[i].solve() pp.saveExpObject( cipde1[i], "D:/Nicolai/MA_Data/experiment0/cipde1_rep_" + str(i) + ".json") print("D:/Nicolai/MA_Data/experiment0/cipde1_rep_" + str(i) + ".json" + " -> saved") ########################## # testbed problem 2 # ########################## cipde2 = [] for i in range(replications): initialPop = np.random.randn(40, 20)