Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 9936e90c authored by David Parsons's avatar David Parsons
Browse files

Re-enable modifying phenotypic target PRNGs

parent e34a11eb
No related branches found
No related tags found
No related merge requests found
......@@ -266,13 +266,9 @@ int main(int argc, char* argv[])
std::make_shared<JumpingMT>(prng->random(1000000)));
exp_manager->world()->set_stoch_prng(
std::make_shared<JumpingMT>(prng->random(1000000)));
// TODO <david.parsons@inria.fr> adapt to new organization
printf("%s:%d: error: feature has to be adapted to the new organization.\n", __FILE__, __LINE__);
exit(EXIT_FAILURE);
// exp_manager->get_env()->set_var_prng(
// std::make_shared<JumpingMT>(prng->random(1000000)));
// exp_manager->get_env()->set_noise_prng(
// std::make_shared<JumpingMT>(prng->random(1000000)));
exp_manager->world()->set_phen_target_prngs(
std::make_shared<JumpingMT>(prng->random(1000000)),
std::make_shared<JumpingMT>(prng->random(1000000)));
}
else
{
......
......@@ -413,6 +413,13 @@ void World::set_stoch_prng(std::shared_ptr<JumpingMT> prng)
}
}
void World::set_phen_target_prngs(std::shared_ptr<JumpingMT> var_prng,
std::shared_ptr<JumpingMT> noise_prng) {
assert(phenotypic_target_shared_);
phenotypic_target_handler_->set_var_prng(var_prng);
phenotypic_target_handler_->set_noise_prng(noise_prng);
}
Individual* World::get_indiv_by_id(int32_t id) const {
Individual* indiv = grid_1d_[id]->get_individual();
// When the population isn't mixed at all, the individual with id n is in
......@@ -427,5 +434,4 @@ Individual* World::get_indiv_by_id(int32_t id) const {
}
return nullptr;
}
} // namespace aevol
......@@ -139,6 +139,9 @@ class World
void save(gzFile backup_file) const;
void load(gzFile backup_file, ExpManager * exp_man);
void set_phen_target_prngs(std::shared_ptr<JumpingMT> var_prng,
std::shared_ptr<JumpingMT> noise_prng);
protected :
// =================================================================
// Protected Methods
......@@ -151,7 +154,7 @@ class World
// =================================================================
// Protected Attributes
// =================================================================
std::shared_ptr<JumpingMT> _prng = NULL;
std::shared_ptr<JumpingMT> _prng = nullptr;
std::shared_ptr<JumpingMT> _mut_prng = nullptr;
std::shared_ptr<JumpingMT> _stoch_prng = nullptr;
......
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