mauriceling / dose

Digital Organism Simulation Environment (DOSE)
https://github.com/mauriceling/dose/wiki
GNU General Public License v3.0
47 stars 34 forks source link

Needs simulation_functions class in dose.py for documentation #28

Closed mauriceling closed 10 years ago

mauriceling commented 10 years ago
  1. Currently, all simulation functions are implemented as a class in examples. This is correct but class simulation_functions does not inherit any class from DOSE.
  2. This is strange as then the user will need to know what functions there are to implement.
  3. We should have a corresponding empty class called "simulation_functions" in dose.py to serve as prototype as well as documentation - let users know what functions there are to implement.

class simulation_functions(): def organism_movement(self, World, x, y, z): pass def organism_location(self, World, x, y, z): pass def ecoregulate(self, World): pass def update_ecology(self, World, x, y, z): pass def update_local(self, World, x, y, z): pass def report(World): pass def fitness(self, Populations, pop_name): pass def mutation_scheme(self, organism): pass def prepopulation_control(self, Populations, pop_name): pass def mating(self, Populations, pop_name): pass def postpopulation_control(self, Populations, pop_name): pass def generation_events(self, Populations, pop_name): pass def population_report(self, Populations, pop_name): pass def deployment_scheme(Populations, pop_name, World): pass

  1. So in the examples, "class simulation_functions()" should be "class simulation_functions(dose.simulation_functions)"
clarencecastillo commented 10 years ago

Updated dose.py to include an empty class of dose_functions that serves as a template for simulation file's simulation_functions. (See commit: 204f514985c0bce212f6eff33dbea72994a934d4)

  1. Simulation file now inherits from dose.py's dose_functions.
  2. All empty functions inside dose_functions class in dose.py raises NotImplentedError to require the user to overwrite/pass the functions inside simulation file's simulation_functions