Skip to content
Extraits de code Groupes Projets
Valider 99df19db rédigé par Jonathan CROUZET's avatar Jonathan CROUZET
Parcourir les fichiers

Debug : Running version

parent 3884a9e6
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
#include <iostream>
#include "../coco/coco.h"
#include "population.h"
#include "tournament.h"
......@@ -7,8 +5,6 @@
#include "mutation.h"
#include "ibea.h"
using namespace std;
void ibea(evaluate_function_t evaluate,
const size_t dimension,
const size_t number_of_objectives,
......@@ -27,7 +23,6 @@ void ibea(evaluate_function_t evaluate,
double kappa = 0.05;
/* Initialize */
cout << "Initialize" << endl;
Population pop = Population(n_individus, dimension, number_of_objectives);
Population new_pop = Population(n_individus, dimension, number_of_objectives);
pop.random_init(lower_bounds, upper_bounds, random_generator);
......@@ -35,33 +30,26 @@ void ibea(evaluate_function_t evaluate,
/* Iterations */
int m = 0;
while (m < n_generations){
cout << "Iterations :" << m << endl;
/* 2 Fitness assignment */
pop.evaluate(evaluate);
pop.compute_indicators();
pop.compute_fitnesses(kappa);
cout << "Evaluation & Fitness done" << endl;
new_pop.empty();
cout << "New population !" << endl;
while (new_pop.getCurrentSize() < n_individus){
/* 3 Environemental select */
pop.darwin(kappa);
cout << "Darwin done" << endl;
/* 4 */
/* 5 Fill mating pool */
binary_tournament(pop, new_pop, mu, random_generator);
cout << "Tournament done" << endl;
}
/* 6 Combination and Mutation */
pop.empty();
combinate(new_pop, pop, eta, p_combination,random_generator);
cout << "Combination done" << endl;
mutate(pop, lower_bounds, upper_bounds, eta, p_mutation, random_generator);
cout << "Mutation done " << m << endl;
m++;
}
}
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter