112 srand(time(NULL)+getpid());
115 MTHREAD->
gen =
new std::mt19937(time(0)+getpid());
118 uniform_int_distribution<> ud(1, 1000000);
184 msgOut(
MSG_INFO,
"Model has ended scheduled simulation in a regular way.");
@ MSG_ERROR
Print an ERROR message, but don't stop the model.
@ MSG_DEBUG
Print a debug message, normally filtered out.
@ MSG_INFO
Print an INFO message.
ThreadManager * MTHREAD
Pointer to the Thread manager.
void msgOut(const int &msgCode_h, const string &msg_h, const bool &refreshGUI_h=true) const
Overloaded function to print the output log.
string i2s(const int &int_h) const
integer to string conversion
void applyForestReclassification()
Apply the forest reclassification with the rules defined in reclRules sheet.
void setSpace()
Set the initial space environment, including loading data from files.
int InitState
One of the 7 possible init states (0..6)
void setInitLevel6()
End of simulation (e.g. print summary statistics)
void setInitLevel5()
Simulation start.
void setInitLevel0()
Unused, reserver for future use.
void setInitLevel(int level_h)
Wrapper to the correct setInitLevelX()
void setInitLevel3()
Linking object to agents and assigning space proprieties to objects and agents.
void setInitLevel1()
Setting up the space, the model objects and the agents (definitions only)
Init(ThreadManager *MTHREAD_h)
void setInitLevel4()
Unused, reserver for future use.
void setInitLevel2()
Unused, reserver for future use.
void cacheSettings()
Called after input reading, it fix frequently used data;.
void setScenarioData()
Set the infos about this scenario (long description and overriding tables)
bool getBoolSetting(const string &name_h, int position=0, int reg=WORLD) const
void setDefaultSettings()
void setScenarioProdData()
void applyDebugMode()
Works only a specified subset of regions and products.
void setDefaultPathogenRules()
void setScenarioPathogenRules()
void setDefaultProdData()
void setScenarioProductResourceMatrixLink()
void setReclassificationRules()
void setScenarioSettings()
int getIntSetting(const string &name_h, int position=0, int reg=WORLD) const
void setDefaultProductResourceMatrixLink()
void applyOverrides()
Cancel all reg1 level data and trasform them in reg2 level if not already existing.
void setScenarioForData()
void fullTest()
Tests that require a full sandbox object including MTHREAD. Normally empty.
void setYear(const int &year_h)
Thread manager. Responsable to manage the main thread and "speak" with the GUI.
void setScenarioName(const string &scenarioName_h)
Scheduler * SCD
the scheduler object (simulation-loops scheduler)
ModelCoreSpatial * SCORE
Core of the model (spatial version)
Sandbox * TEST
Various debugging code for development.
Gis * GIS
GIS information and methods.
ModelData * MD
the model data object
std::mt19937 * gen
used in the sampling from normal distribution
ModelCore * CORE
Core of the model.