# 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) # Create Genetic Algorithm with own individual and behavior genAlg = PYGA_GenAlg(Individual, 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, crossrate=25, mutaterate=40, select='best',
import os import util # - PYGA imports - from PYGA_GenAlg import PYGA_GenAlg # - Local imports - from RefModel import RefModel from Individual import Individual from GenAlgBehavior import MyGenAlgBehavior # Definition of the list of enable operators Individual.opListLoad('../inputs/operatorsList.txt') #Individual.opListLoad('./model_001_0.0225887259063_11.ind') MyGenAlgBehavior.loadDirectories('.') # 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") outputList = 'info-improvement end-pareto end-convergence' for k in range(1): # Set the seed util.setSeed(k)