43 typedef map<string, vector <double> >
DataMap;
44 typedef pair<string, vector <double> >
DataPair;
90 LLData getTableFromFile(
string tablename,
string filename_h);
91 vector<string> getScenarios();
92 int getScenarioIndex();
93 bool delDir(QString dirname);
94 void setScenarioData();
95 void setDefaultSettings();
96 void setScenarioSettings();
98 void setDefaultForData();
99 void setScenarioForData();
100 void setDefaultProdData();
101 void setScenarioProdData();
102 void setDefaultProductResourceMatrixLink();
103 void setScenarioProductResourceMatrixLink();
104 void setForestTypes();
105 void setReclassificationRules();
106 void setDefaultPathogenRules();
107 void setScenarioPathogenRules();
108 void applyOverrides();
109 void applyDebugMode();
114 int getFilenamesByDir (
const string & dir, vector<string> &files,
const string &filter =
"");
115 string getFilenameByType(
string type_h);
120 bool regionExist (
const int & regId_h)
const ;
121 vector <ModelRegion*> getAllRegions(
bool excludeResidual=
true);
122 vector<int> getRegionIds(
int level_h,
bool excludeResidual=
true);
123 vector < vector <int> > getRegionIds(
bool excludeResidual=
true);
124 string regId2RegSName (
const int & regId_h)
const ;
125 int regSName2RegId (
const string & regSName_h)
const ;
129 forType* getForType(
string& forTypeId_h);
130 int getForTypeCounter(
string& forTypeId_h,
bool all=
false);
131 vector <string> getForTypeIds(
bool all=
false);
132 string getForTypeParentId(
const string& forTypeId_h);
133 vector<string> getForTypeChilds(
const string &forTypeId_h);
134 vector<int> getForTypeChilds_pos(
const string &forTypeId_h,
bool all=
false);
135 vector<string> getForTypeParents();
136 int getNForTypesChilds(
const string& forTypeId_h);
138 vector <string> getDiameterClasses(
bool productionOnly=
false);
140 const bool assessProdPossibility(
const string &prod_h,
const string &forType_h,
const string &dClass_h);
141 const int getMaxYearUsableDeathTimber(
const string &prod_h,
const string &forType_h,
const string &dClass_h);
142 const int getMaxYearUsableDeathTimber();
150 vector < vector <int> > createCombinationsVector(
const int& nItems);
152 double getTimedData(
const vector <double> &dated_vector,
const int& year_h)
const;
153 void setTimedData(
const double& value_h, vector<double> &dated_vector,
const int& year_h,
const int& MSG_LEVEL=
MSG_WARNING);
155 int getIntSetting (
const string &name_h,
int position=0,
int reg=
WORLD)
const;
156 double getDoubleSetting (
const string &name_h,
int position=0,
int reg=
WORLD)
const;
157 string getStringSetting (
const string &name_h,
int position=0,
int reg=
WORLD)
const;
158 bool getBoolSetting (
const string &name_h,
int position=0,
int reg=
WORLD)
const;
159 vector <int> getIntVectorSetting (
const string &name_h,
int reg=
WORLD)
const;
160 vector <double> getDoubleVectorSetting (
const string &name_h,
int reg=
WORLD)
const;
161 vector <string> getStringVectorSetting (
const string &name_h,
int reg=
WORLD)
const;
162 vector <bool> getBoolVectorSetting (
const string &name_h,
int reg=
WORLD)
const;
165 const double getProdData(
const string &type_h,
const int& regId_h,
const string &prodId_h,
const int &year=
DATA_NOW,
const string &freeDim_h=
"");
166 const double getForData(
const string &type_h,
const int& regId_h,
const string &forType_h,
const string &freeDim_h,
const int& year=
DATA_NOW);
169 void setProdData(
const double& value_h,
const string &type_h,
const int& regId_h,
const string &prodId_h,
const int& year=
DATA_NOW,
const bool& allowCreate=
false,
const string &freeDim_h=
"");
170 void setForData(
const double& value_h,
const string &type_h,
const int& regId_h,
const string &forType_h,
const string &freeDim_h,
const int& year=
DATA_NOW,
const bool& allowCreate=
false);
172 string makeKeyProdData(
const string& parName,
const string& regId,
const string& prod,
const string& freeDim=
"")
const {
return parName+
"#"+regId+
"#"+prod+
"#"+freeDim+
"#";}
173 string makeKeyForData(
const string& parName,
const string& regId,
const string&
forType,
const string& diamClass)
const {
return parName+
"#"+regId+
"#"+forType+
"#"+diamClass+
"#";}
174 void unpackKeyProdData(
const string& key,
string& parName,
int ®Id,
string& prod,
string& freeDim)
const;
175 void unpackKeyForData(
const string& key,
string& parName,
int ®Id,
string&
forType,
string& diamClass)
const;
177 vector<pathRule*> getPathMortalityRule(
const string& forType,
const string& dC);
179 double calculateAnnualisedEquivalent(
const double& amount_h,
const int& years_h,
const double& ir)
const;
180 double calculateAnnualisedEquivalent(
const double& amount_h,
const double& years_h,
const double& ir)
const;
182 void setOutputDirectory(
const char* output_dirname_h);
184 void addSetting(
string name_h, vector <string> values_h,
int type_h,
string comment_h);
185 void addSetting(
string name_h,
string value_h,
int type_h,
string comment_h);
186 void cacheSettings();
199 double getAvailableDeathTimber(
const vector<string> &primProd_h,
int regId_h,
int year_h);
200 double getAvailableAliveTimber(
const vector<string> &primProd_h,
int regId_h);
201 vector <int> getAllocableProductIdsFromDeathTimber(
const int ®Id_h,
const string &ft,
const string &dc,
const int &harvesting_year,
int request_year=
DATA_NOW);
205 string getBaseData (
const string &name_h,
int type_h,
int position=0,
int regId_h=
WORLD);
206 vector <string> getVectorBaseData (
const string &name_h,
int type_h,
int regId_h=
WORLD);
209 bool dataMapCheckExist(
const DataMap& map,
const string& search_for,
const bool& exactMatch=
true)
const;
210 double dataMapGetValue(
const DataMap& map,
const string& search_for,
const int& year_h,
const bool& exactMatch=
true);
211 int dataMapSetValue(
DataMap& map,
const string& search_for,
const double& value_h,
const int& year_h,
const bool& exactMatch=
true);
229 vector < vector <int> >
l2r;
338 string getData(
const int& pos_h,
const string& header_h,
const int& debugLevel=
MSG_CRITICAL_ERROR)
const;
Class to provide a simple integer-integer-string-string key in std maps.
The required data is for the current year.
InputNode mainDocument
For each agricultural soil type (as defined in the setting "agrLandTypes") this list define the objec...
bool tempBool
a temporary bool variable used for various functions
string pathId
Pathogen id (name)
IO production matrix between the forest resources and the primary products (struct) ...
vector< reclRule > reclRules
Vector of reclassification rules.
reclRule * getReclRule(int position)
string getBaseDirectory() const
double pres_min
Minimum level of presence of the pathogen to be counted as present (tolerance threshold) ...
Request something that is not region-specific.
vector< LLData > LLDataVector
Vector of Low Level Data.
Basic data units (struct)
int getCachedInitialYear()
Thread manager. Responsable to manage the main thread and "speak" with the GUI.
vector< double > mortCoefficents
Mortality coefficients ordered by number of presence of the pathogen, e.g. first value is the mortali...
map< iisskey, double > * getDeathTimberInventory()
double deathTimberInventory_get(const iisskey &thekey)
map< string, vector< double > > prodDataMap
Product data.
void printProductData(bool finalFlush)
vector< IFiles > iFilesVector
List of all input files. Simple (struct)
Regional data, including macros and settings.
int maxYears
The maximum year for a tree collapse that this product can be harvested from. E.g. a 0 value means it can be obtained only from live trees, a 5 years value mean it can be obtained from trees death no longer than 5 years ago.
Print an error message and stop the model.
void loadInput()
Unzip the OpenOffice input file (NEW 2008.05.13)
void setValueFoundBool(bool valueFoundBool_h)
Define layer objects at the regional level.
void setTempBool(bool tempBool_h)
vector< string > priProducts
map< string, vector< double > > DataMap
vector< pathRule > pathRules
Vector of pathogen rules.
Base class for the regmas application.
vector< string > secProducts
string makeKeyForData(const string &parName, const string ®Id, const string &forType, const string &diamClass) const
bool valueFoundBool
a bool used in getForData() and getProdData() to communicate they didn't found a variable ...
vector< vector< int > > l2r
Region2 ids.
map< string, vector< double > > DataMap
void setErrorLevel(int errorLevel_h)
vector< forToProd > forToProdVector
Vector of coefficients from forest resources to primary products.
Pathogen rule (how pathogen presense influence mortality) for a given forest type and diameter class ...
string getOutputDirectory() const
Return a vector of objects that together provide the specified resource in the specified quantity...
vector< string > allProducts
vector< ModelRegion > regionsVector
Vector of modelled regions.
vector< string > values
Values are stored as "string" because we don't yet know at this point if they are string...
vector< BasicData > programSettingsVector
Setting data. Simple (struct)
string makeKeyProdData(const string &parName, const string ®Id, const string &prod, const string &freeDim="") const
void printForestData(bool finalFlush)
This file is the header of BaseClass and it is included by ALL compiled code.
void deathTimberInventory_incrOrAdd(const iisskey &thekey, double value_h)
vector< forType > forTypes
Vector of forest types.
vector< IFiles > getIFilesVector() const
void deathTimberInventory_incr(const iisskey &thekey, double value_h)
pair< string, vector< double > > DataPair
IO production matrix between the forest resources and the primary products (struct) ...
map< string, vector< double > > forDataMap
Forestry data.
vector< vector< string > > records
vector< string > diamClasses
Diameter classes.
map< iisskey, double > deathTimberInventory
Map that register the death of biomass still usable as timber by year, l2_region, forest type and dia...
void setBaseDiretory(string baseDirectory_h)
forType * getForType(int position)
Low level data. XML input is reversed here after unzipping oocalc file and parsing content...