from RefModel import RefModel from Individual import Individual from GenAlgBehavior import MyGenAlgBehavior # Definition of the list of enable operators Individual.opListLoad('../inputs/operatorsList.txt') # Chargement des paramètres de mutation Individual.mutationParametersLoad("../inputs/MutationParameters_Full.txt") # Definition of the Reference Model Individual.setRefModel(RefModel("Sextic")) # Error and Post-Processing Individual.setErrorMethod("mse") Individual.setPostProcessing("scalling") # Set the seed util.setSeed(1392931746.79) # Definition of the result Directory resultDir = "workingDir" os.system('rm -rf workingDir/*') MyGenAlgBehavior.setResultDir(resultDir) # Definition du niveau de blabla MyGenAlgBehavior.setVerboseLevel(3) # Copy of the main & seed files in the result directory os.system("cp " + __file__ + " " + resultDir) os.system("cp seed.txt " + resultDir) # Create Genetic Algorithm with own individual and behavior genAlg = PYGA_GenAlg(Individual, MyGenAlgBehavior) # Set paramaters of the GA genAlg.setParameters(pop_size=20,
from Individual import Individual from GenAlgBehavior import MyGenAlgBehavior # Definition of the list of enable operators Individual.opListLoad('../inputs/operatorsList.txt') # Chargement des paramètres de mutation Individual.mutationParametersLoad("../inputs/MutationParameters_Choice.txt") # Definition of the Reference Model Individual.setRefModel(RefModel("../inputs/Model_Davidson1.txt")) # Error and Post-Processing Individual.setErrorMethod("mse") Individual.setPostProcessing("scalling") for k in range(10): # Set the seed util.setSeed(k) # Definition of the result Directory resultDir = "result_" + __file__.replace(".py", "") + "_" + util.getDate() MyGenAlgBehavior.setResultDir(resultDir) # Definition du niveau de blabla MyGenAlgBehavior.setVerboseLevel(3) # Copy of the main & seed files in the result directory os.system("cp " + __file__ + " " + resultDir) os.system("cp seed.txt " + resultDir) # Create Genetic Algorithm with own individual and behavior genAlg = PYGA_GenAlg(Individual, MyGenAlgBehavior) # Set paramaters of the GA genAlg.setParameters(pop_size=200, nb_gen=10000,
# Definition of the list of enable operators Individual.opListLoad('../inputs/operatorsList.txt') # Chargement des paramètres de mutation Individual.mutationParametersLoad(inputParamFile) # Definition of the Reference Model Individual.setRefModel(RefModel(inputDataFile)) # Error and Post-Processing Individual.setErrorMethod("mse") Individual.setPostProcessing("scalling") outputList = 'tmp-progress end-pareto end-convergence' for k in range(inputRunNb): # Set the seed util.setSeed() # Result directory definition resultDir = inputDirName+"_"+'{0:03}'.format(k+1) os.system("rm -rf "+resultDir+"/*") MyGenAlgBehavior.setResultDir(resultDir) # Tmp Dir tmpDir = '/tmp/tmpSymReg/'+resultDir.split('/')[-1] os.system("rm -rf "+tmpDir+"/*") MyGenAlgBehavior.setTmpDir(tmpDir) # Outputs definition MyGenAlgBehavior.setOutputList(outputList) # Copy of the main & seed files in the result directory os.system("cp seed.txt "+resultDir)