Nemo  2.3.46
simenv.h
Go to the documentation of this file.
1 
30 #ifndef SIMENV_H
31 #define SIMENV_H
32 
33 #include "simulation.h"
34 
36 class SIMenv {
37 
38  SIMenv(){}
39 
40 public:
41 
42  static SimRunner* MainSim;
43 
44  static void loadDefaultComponents(SimRunner* sim);
45 
46  static SimRunner* setMainSim ( Metapop *pop ) {
47  MainSim = new SimRunner( pop );
48  loadDefaultComponents( MainSim );
49  return MainSim;
50  }
51 
53  SimRunner *sim = new SimRunner( new Metapop() );
54  loadDefaultComponents( sim );
55  return sim;
56  }
57 
58  static void setMainSim( SimRunner* sim) {MainSim = sim;}
59 
60  static unsigned int getCurrentGeneration() {return MainSim->getCurrentGeneration();}
61  static unsigned int getGenerations() {return MainSim->getGenerations();}
62  static unsigned int getCurrentReplicate() {return MainSim->getCurrentReplicate();}
63  static unsigned int getReplicates() {return MainSim->getReplicates();}
64  static int getCurrentRankInLifeCycle() {return MainSim->getCurrentRankInLifeCycle();}
65 };
66 
67 #endif
unsigned int getGenerations()
Definition: simulation.h:190
static unsigned int getReplicates()
Definition: simenv.h:63
unsigned int getCurrentReplicate()
Definition: simulation.h:192
Top class of the metapopulation structure, contains the patches.
Definition: metapop.h:79
static SimRunner * MainSim
Definition: simenv.h:42
unsigned int getReplicates()
Definition: simulation.h:194
static unsigned int getCurrentReplicate()
Definition: simenv.h:62
static SimRunner * getNewSimulation()
Definition: simenv.h:52
Performs the setup of the Metapop and SimComponents and runs the simulation.
Definition: simulation.h:53
static unsigned int getCurrentGeneration()
Definition: simenv.h:60
static SimRunner * setMainSim(Metapop *pop)
Definition: simenv.h:46
static int getCurrentRankInLifeCycle()
Definition: simenv.h:64
Global class exposing the current SimRunner throughout the code.
Definition: simenv.h:36
unsigned int getCurrentGeneration()
Definition: simulation.h:188
SIMenv()
Definition: simenv.h:38
static void setMainSim(SimRunner *sim)
Definition: simenv.h:58
static void loadDefaultComponents(SimRunner *sim)
Definition: simenv.cc:53
static unsigned int getGenerations()
Definition: simenv.h:61
int getCurrentRankInLifeCycle()
Definition: simulation.h:195

Generated for Nemo v2.3.0 by  doxygen 1.8.8 --
Catalogued on GSR