def getFrontPareto(start_fct, nb_functions, decision_space, objective_space, nb_iterations, neighboring_size, bitstring_size, nb_flips, max_decisions_maj, delta_neighbourhood, CR, sleeptime=10): global param #random initialisation init_decisions = initRandom(decision_space, nb_functions, bitstring_size) #get objective space representation of the solution objective_space = sp.getObjectiveSpace(start_fct, decision_space) #algorithm parameters param = [objective_space, decision_space, start_fct, nb_functions, nb_iterations, neighboring_size, init_decisions, bitstring_size, nb_flips, max_decisions_maj, delta_neighbourhood, CR] #launch the graphic view and the algorithm result = gph.runAnimatedGraph(runTcheby,"Front pareto Tcheby Evolution","f1 - count 1" ,"f2 - count 0", sleep=sleeptime) return result
def getFrontParetoWithGraphic(problem_title, start_fct, operator_fct, generation_fct, pareto_front_fct, nb_functions, nb_iterations, neighboring_size, problem_size, max_decisions_maj, delta_neighbourhood, CR, search_space, F, distrib_index_n, pm, manage_archive, file_to_write, sleeptime=10): global param, archiveOK if(manage_archive): archiveOK = True #random initialisation init_decisions = init_to.initRandom(generation_fct, nb_functions, problem_size, search_space) #algorithm parameters param = [start_fct, nb_functions, nb_iterations, neighboring_size, init_decisions, problem_size, max_decisions_maj, delta_neighbourhood, CR, search_space, F, distrib_index_n, pm, operator_fct, "none", -1] #function that will be called by runAnimatedGraph before it's end end_function = getResult #launch the graphic view and the algorithm result = gph.runAnimatedGraph(runTcheby,end_function, pareto_front_fct, problem_title ,"f1" ,"f2", sleep=sleeptime) #return the approximation of the pareto front and the archive if managed return result