Evolutionary Diversification in Anolis Lizards
simulation.hpp
Go to the documentation of this file.
1 
12 #pragma once
13 #ifndef SIMULATION_HPP_
14 #define SIMULATION_HPP_
15 
16 #include <iosfwd>
17 #include <string>
18 #include <vector>
19 #include <memory>
20 #include <random>
21 
23 namespace edal {
24 
25 class Patch;
26 
29 class Simulation {
30  public:
32  Simulation(int argc, char* argv[]);
34  ~Simulation();
35 
37  void run();
38 
39  private:
41 
44  void evolve();
46 
58  void life_cycle();
59 
61 
64  void write_snapshot(const size_t time, std::ostream& ost) const;
65 
67  // data members
69  std::vector<std::vector<Patch> > population;
70 
72  bool verbose_ = false;
73 };
74 
75 } // namespace edal
76 
77 #endif /* SIMULATION_HPP_ */
std::vector< std::vector< Patch > > population
Two-dimensional matrix of Patch.
Definition: simulation.hpp:69
Simulation(int argc, char *argv[])
Parse command arguments.
Definition: simulation.cpp:104
void run()
Top level function that should be called from main()
Definition: simulation.cpp:173
void write_snapshot(const size_t time, std::ostream &ost) const
output genotype frequencies for each patch
Definition: simulation.cpp:273
void life_cycle()
One step forward.
Definition: simulation.cpp:232
Represents single run.
Definition: simulation.hpp:29
Definition: individual.cpp:15
~Simulation()
destructor in cpp for incomplete type
void evolve()
Call life_cycle() repeatedly.
Definition: simulation.cpp:191
bool verbose_
Print verbose output.
Definition: simulation.hpp:72