Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 3cccb8a0 authored by LUISELLI Juliette's avatar LUISELLI Juliette
Browse files

adapt the init() of ReplicationReport to the eukaryotic case

parent 3fa3dda5
No related branches found
No related tags found
No related merge requests found
...@@ -215,6 +215,36 @@ void ReplicationReport::init(Individual* offspring, Individual* parent, int indi ...@@ -215,6 +215,36 @@ void ReplicationReport::init(Individual* offspring, Individual* parent, int indi
mean_align_score_ = 0.0; mean_align_score_ = 0.0;
} }
#ifdef __EUKARYOTE
void ReplicationReport::init(Individual_7* offspring,
Individual_7* parent1, Individual_7* parent2,
int indiv_id, int parent1_id, int parent2_id){
dna_replic_report_.clear();
simd_indiv_ = offspring;
id_ = (unsigned long long) indiv_id;
parent_id_ = (unsigned long long) parent1_id;
parent2_id_ = (unsigned long long) parent2_id;
genome_size_ = 0;
metabolic_error_ = 0.0;
nb_genes_activ_ = 0;
nb_genes_inhib_ = 0;
nb_non_fun_genes_ = 0;
nb_coding_RNAs_ = 0;
nb_non_coding_RNAs_ = 0;
parent_metabolic_error_ = parent1->metaerror;
parent_secretion_error_ = 0.0;
parent_genome_size_ = parent1->dna_length();
mean_align_score_ = 0.0;
parent2_metabolic_error_ = parent2->metaerror;
parent2_secretion_error_ = 0.0;
parent2_genome_size_ = parent2->dna_length();
}
#else
void ReplicationReport::init(Individual_7* offspring, void ReplicationReport::init(Individual_7* offspring,
Individual_7* parent, Individual_7* parent,
int indiv_id, int indiv_id,
...@@ -246,6 +276,7 @@ void ReplicationReport::init(Individual_7* offspring, ...@@ -246,6 +276,7 @@ void ReplicationReport::init(Individual_7* offspring,
dna_replic_report_.clear(); dna_replic_report_.clear();
} }
#endif
/** /**
* Method called at the end of the replication of an individual. * Method called at the end of the replication of an individual.
......
...@@ -138,10 +138,17 @@ class ReplicationReport : public Observer { ...@@ -138,10 +138,17 @@ class ReplicationReport : public Observer {
void signal_end_of_replication(Individual* indiv); void signal_end_of_replication(Individual* indiv);
#endif #endif
#ifdef __EUKARYOTE
void init(Individual_7* offspring,
Individual_7* parent1, Individual_7* parent2,
int indiv_id, int parent1_id, int parent2_id);
#else
void init(Individual_7* offspring, void init(Individual_7* offspring,
Individual_7* parent, Individual_7* parent,
int indiv_id, int indiv_id,
int parent_id); int parent_id);
#endif
void signal_end_of_replication(Individual_7* indiv); void signal_end_of_replication(Individual_7* indiv);
void signal_end_of_generation(); void signal_end_of_generation();
...@@ -154,6 +161,9 @@ class ReplicationReport : public Observer { ...@@ -154,6 +161,9 @@ class ReplicationReport : public Observer {
unsigned long long id_ = 0; unsigned long long id_ = 0;
unsigned long long parent_id_ = 0; unsigned long long parent_id_ = 0;
#ifdef __EUKARYOTE
unsigned long long parent2_id_ = 0;
#endif
protected : protected :
// ================================================================= // =================================================================
...@@ -186,6 +196,12 @@ Individual* indiv_ = nullptr; ...@@ -186,6 +196,12 @@ Individual* indiv_ = nullptr;
double parent_secretion_error_ = -1; double parent_secretion_error_ = -1;
int32_t parent_genome_size_ = -1; int32_t parent_genome_size_ = -1;
#ifdef __EUKARYOTE
double parent2_metabolic_error_ = -1;
double parent2_secretion_error_ = -1;
int32_t parent2_genome_size_ = -1;
#endif
int32_t donor_id_ = -1; int32_t donor_id_ = -1;
double donor_metabolic_error_ = -1; double donor_metabolic_error_ = -1;
double donor_secretion_error_ = -1; double donor_secretion_error_ = -1;
......
...@@ -199,9 +199,14 @@ Tree::~Tree() noexcept { ...@@ -199,9 +199,14 @@ Tree::~Tree() noexcept {
} }
void Tree::update_new_indiv(NewIndivEvent* evt) { void Tree::update_new_indiv(NewIndivEvent* evt) {
replics_[Utils::mod(AeTime::time() - 1, tree_step_)] #ifdef __EUKARYOTE
[evt->x * exp_manager->grid_height() + evt->y]->init( replics_[Utils::mod(AeTime::time() - 1, tree_step_)][evt->x * exp_manager->grid_height() + evt->y]->init(
evt->simd_child, evt->simd_parent, evt->simd_parent2,
evt->indiv_id_, evt->parent_id_, evt->parent2_id_);
#else
replics_[Utils::mod(AeTime::time() - 1, tree_step_)][evt->x * exp_manager->grid_height() + evt->y]->init(
evt->simd_child, evt->simd_parent, evt->indiv_id_, evt->parent_id_); evt->simd_child, evt->simd_parent, evt->indiv_id_, evt->parent_id_);
#endif
} }
void Tree::update_end_replication(EndReplicationEvent* evt) { void Tree::update_end_replication(EndReplicationEvent* evt) {
...@@ -221,9 +226,13 @@ void Tree::update(Observable&, ObservableEvent e, void* arg) { ...@@ -221,9 +226,13 @@ void Tree::update(Observable&, ObservableEvent e, void* arg) {
// Initialize the replication report corresponding to the new individual // Initialize the replication report corresponding to the new individual
auto ievent = reinterpret_cast<NewIndivEvent*>(arg); auto ievent = reinterpret_cast<NewIndivEvent*>(arg);
replics_[Utils::mod(AeTime::time() - 1, tree_step_)] #ifdef __EUKARYOTE
[ievent->x * exp_manager->grid_height() + ievent->y]->init( replics_[Utils::mod(AeTime::time() - 1, tree_step_)][ievent->x * exp_manager->grid_height() + ievent->y]->init(
ievent->simd_child, ievent->simd_parent, ievent->simd_parent2, ievent->indiv_id_, ievent->parent_id_, ievent->parent2_id_);
#else
replics_[Utils::mod(AeTime::time() - 1, tree_step_)][ievent->x * exp_manager->grid_height() + ievent->y]->init(
ievent->simd_child, ievent->simd_parent, ievent->indiv_id_, ievent->parent_id_); ievent->simd_child, ievent->simd_parent, ievent->indiv_id_, ievent->parent_id_);
#endif
break; break;
} }
case END_GENERATION : { case END_GENERATION : {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment