Refactor revive_simulation() and simulate() to call simulation_core()
Closed this issue · 1 comments
clarencecastillo commented
- simulate() and revive_simulation() in dose.py contains the exact same block of code, with the exception that:
- simulate() calls on prepare_simulation() whereas revive_simulation() calls prepare_revival()
- simulate() deploys the organism whereas revive_simulation() does not
- simulate() depends on "maximum_generations" for its generation count, whereas revive_simulation() depends on "extend_gen"
- It seems that the largest contrast among the two would be how they prepare the simulation (creation of simulation parameters, functions, World and Populations).
- Re-factor both revive_simulation() (rename it to 'rev_simulate()') and simulate() to call simulation_core() that contains the common codes they use.
clarencecastillo commented
Completed. (See commit: e42bf57)
- simulate() and revive_simulation() now call on simulation_core() to run the main simulation.
- preparation of simulations now work in dose.py level, before calling simulation_core()