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