Commit 869a81c3 authored by SINDT--BARET Yanis's avatar SINDT--BARET Yanis Committed by SINDT--BARET Yanis
Browse files

[Update] Update of datacollecting

Data file updating. Now can give too the mutation type (MutationEven changed) in the result data, that allow to show a graphic with different color.
parent 19ea9926
......@@ -58,7 +58,7 @@ aevol::MutationEvent MutationFactorySswm::do_mutation(aevol::Individual_7& indiv
int segment_length = pos_2 - pos_1;
auto mevent = aevol::MutationEvent();
mevent.inversion(pos_1, pos_2, segment_length);
printf("- Its a inversion\n");
// printf("- Its a inversion\n");
return mevent;
}
// _____If not inversion
......@@ -66,7 +66,7 @@ aevol::MutationEvent MutationFactorySswm::do_mutation(aevol::Individual_7& indiv
int32_t pos = prng_nb->random(dna_lenght);
auto mevent = aevol::MutationEvent();
mevent.switch_pos(pos);
printf("Its a ponctual mutation\n");
// printf("Its a ponctual mutation\n");
return mevent;
}
}
......@@ -88,9 +88,11 @@ class MutationEvent {
char base() const { return base_; }
#endif
private:
int32_t type_;
private:
int32_t pos_1_,pos_2_,pos_3_,pos_4_;
int32_t number_; // insertion or deletion
......
......@@ -157,7 +157,7 @@ int main(int argc, char* argv[]) {
remove("sswm_result.csv");
std::ofstream data("sswm_result.csv", std::ios::app);
data << "non_mutant,mutant" << std::endl;
data << " nb_gen,non_mutant,mutant,mutation" << std::endl;
if (data) {
for (int i = 0; i<nb_gen;i++) {
MutationFactorySswm mutationFactorySswm =
......@@ -168,7 +168,7 @@ int main(int argc, char* argv[]) {
new_indiv->evaluate_after_mutation(target, p.w_max, p.selection_pressure,
fuzzyFac);
// print_step(i, individual, new_indiv); Si on veut print les infos
data << i << "," << individual->fitness << "," << new_indiv->fitness << "," << std::endl;
data << i << "," << individual->fitness << "," << new_indiv->fitness << "," << mutationEvent.type_ << std::endl;
if (individual->fitness <= new_indiv->fitness) {
delete individual;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment