FFSM++  1.1.0
French Forest Sector Model ++
ModelRegion Class Reference

#include <ModelRegion.h>

Inheritance diagram for ModelRegion:
Collaboration diagram for ModelRegion:

Public Member Functions

 ModelRegion (ThreadManager *MTHREAD_h, int regId_h, string regSName_h, string regLName_h, int regLevel_h, int parRegId_h, bool isResidual_h)
 Constructor. More...
 
 ~ModelRegion ()
 
void setRegId (int regId_h)
 
void setRegSName (string regSName_h)
 
void setRegLName (string regLName_h)
 
void setRegLevel (int regLevel_h)
 
void setParRegId (int parRegId_h)
 
void setIsResidual (bool isResidual_h)
 
void setParent (ModelRegion *parRegion_h)
 
void setChildren (vector< ModelRegion * > children_h)
 
void addForData (forData *data_h)
 Childrens are all the lvel-1 region that are parts of this region. More...
 
void addProdData (prodData *data_h)
 
void setMyPixels ()
 It sets a double link pixels <–> region. More...
 
void swap (const int &swap_what)
 
int getRegId () const
 
string getRegSName () const
 
string getRegLName () const
 
int getRegLevel () const
 
int getParRegId () const
 
bool getIsResidual () const
 
ModelRegiongetParent ()
 
vector< ModelRegion * > getChildren (bool excludeResidual=true)
 Returns a pointer to the parent regions. More...
 
vector< ModelRegion * > getSiblings (bool excludeResidual=true)
 Return a vector of pointers to the siblings regions. More...
 
double getVolumes ()
 
vector< double > getVolumes (int fType_h)
 
double getValue (string layerName, int op=OP_SUM)
 return the values of its own pixels for the specified layer. Possible operations: OP_SUM or OP_AVG More...
 
vector< vector< double > > getVolumes (int fType_h, string dClass_h)
 
double getArea (const string &fType_h, const string &dClass_h)
 Get area by ft and dc (from pixel->area matrix) More...
 
double getArea (const string &fType_h)
 Get area by ft (from pixel->area matrix) More...
 
double getArea (const int &ft_pos, const int &dc_pos)
 Get area by ft and dc positions (from pixel->area matrix) More...
 
double getArea (const int &ft_pos)
 Get area by ft position (from pixel->area matrix) More...
 
double getArea ()
 Get whole forest area (from pixel->area matrix) More...
 
int getNChildren (bool excludeResidual=true)
 
vector< Pixel * > getMyPixels ()
 
- Public Member Functions inherited from BaseClass
 BaseClass ()
 
 ~BaseClass ()
 
void msgOut (const int &msgCode_h, const string &msg_h, const bool &refreshGUI_h=true) const
 Overloaded function to print the output log. More...
 
void msgOut (const int &msgCode_h, const int &msg_h, const bool &refreshGUI_h=true) const
 Overloaded function to print the output log. More...
 
void msgOut (const int &msgCode_h, const double &msg_h, const bool &refreshGUI_h=true) const
 Overloaded function to print the output log. More...
 
int s2i (const string &string_h) const
 string to integer conversion More...
 
double s2d (const string &string_h) const
 string to double conversion More...
 
double s2d (const string &string_h, const bool &replaceComma) const
 string to double conversion More...
 
bool s2b (const string &string_h) const
 string to bool conversion More...
 
string i2s (const int &int_h) const
 integer to string conversion More...
 
string d2s (const double &double_h) const
 double to string conversion More...
 
string b2s (const bool &bool_h) const
 bool to string conversion More...
 
vector< int > s2i (const vector< string > &string_h) const
 string to integer conversion (vector) More...
 
vector< double > s2d (const vector< string > &string_h, const bool &replaceComma=false) const
 string to double conversion (vector) More...
 
vector< bool > s2b (const vector< string > &string_h) const
 string to bool conversion (vector) More...
 
vector< string > i2s (const vector< int > &int_h) const
 integer to string conversion (vector) More...
 
vector< string > d2s (const vector< double > &double_h) const
 double to string conversion (vector) More...
 
vector< string > b2s (const vector< bool > &bool_h) const
 bool to string conversion (vector) More...
 
int getType (const string &type_h) const
 Return a type according to enum TYPE_* from a string (eg: "string" -> TYPE_STRING (2)) More...
 
void refreshGUI () const
 Ping to periodically return the control to the GUI. More...
 
template<typename T >
string toString (const T &x) const
 
template<typename T >
stringTo (const std::string &s) const
 
int vSum (const vector< int > &vector_h) const
 
double vSum (const vector< double > &vector_h) const
 
int vSum (const vector< vector< int > > &vector_h) const
 
double vSum (const vector< vector< double > > &vector_h) const
 
void tokenize (const string &str, vector< string > &tokens, const string &delimiter=" ") const
 Tokenize a string using a delimiter (default is space) More...
 
void untokenize (string &str, vector< string > &tokens, const string &delimiter=" ") const
 
template<typename K , typename V >
findMap (const map< K, V > &mymap, const K &key, const int &error_level=MSG_CRITICAL_ERROR, const V &notFoundValue=numeric_limits< V >::min()) const
 Lookup a map for a value. Return the value starting from the key. More...
 
template<typename K , typename V >
void changeMapValue (map< K, V > &mymap, const K &key, const V &value, const int &error_level=MSG_CRITICAL_ERROR)
 Change the value stored in a map given the key and the new value. More...
 
template<typename K , typename V >
void incrMapValue (map< K, V > &mymap, const K &key, const V &value, const int &error_level=MSG_CRITICAL_ERROR)
 Increments a value stored in a map of the specified value, given the key. More...
 
template<typename K , typename V >
void incrOrAddMapValue (map< K, V > &mymap, const K &key, const V &value)
 Increments a value stored in a map of the specified value, given the key. More...
 
template<typename K , typename V >
void resetMapValues (map< K, V > &mymap, const V &value)
 Reset all values stored in a map to the specified one. More...
 
template<typename K , typename V >
map< K, V > vectorToMap (const vector< K > &keys, const V &value=0.0)
 Returns a map built using the given vector and the given (scalar) value as keys/values pairs. More...
 
template<typename T >
vector< T > positionsToContent (const vector< T > &vector_h, const vector< int > &positions)
 Return a vector of content from a vector and a vector of positions (int) More...
 
template<typename V >
void debugMap (const map< iisskey, V > &mymap)
 Debug a map. More...
 
template<typename K , typename V >
void debugMap (const map< K, V > &mymap, const K &key)
 
template<typename K >
int getMaxPos (const vector< K > &v)
 Returns the position of the maximum element in the vector (the last one in case of multiple equivalent maxima) More...
 
template<typename K >
int getMinPos (const vector< K > &v)
 Returns the position of the minimum element in the vector (the first one in case of multiple equivalent minima) More...
 
template<typename K >
getMax (const vector< K > &v)
 Returns the value of the maximum element in the vector (the last one in case of multiple equivalent maxima) More...
 
template<typename K >
getMin (const vector< K > &v)
 Returns the value of the minimum element in the vector (the first one in case of multiple equivalent minima) More...
 
template<typename K >
double getAvg (const vector< K > &v)
 Returns the average of the elements in the vector. More...
 
template<typename K >
double getSd (const vector< K > &v, bool sample=true)
 
template<typename K >
int getPos (const K &element, const vector< K > &v, const int &msgCode_h=MSG_CRITICAL_ERROR)
 
template<typename K >
bool inVector (const K &element, const vector< K > &v)
 
double normSample (const double &avg, const double &stdev, const double &minval=NULL, const double &maxval=NULL) const
 Sample from a normal distribution with bounds. Slower (double time, but still you see the diff only after milion of loops). More...
 
template<typename K >
normSample (normal_distribution< K > &d, std::mt19937 &gen, const K &minval=NULL, const K &maxval=NULL) const
 Sample from a normal distribution with bounds. Faster (half time) as the normal_distribution is made only once. More...
 
template<typename T >
std::string toString (const T &x) const
 

Public Attributes

vector< double > inResByAnyCombination
 Vector of inventory resource for each possible combination of primary products. This store both alive timber and death one. More...
 

Private Attributes

int regId
 Regional unique ID. More...
 
string regSName
 A short name of the region. More...
 
string regLName
 Region long name;. More...
 
int regLevel
 The level of the region. 1: country, 2: regions. More...
 
int parRegId
 Id of the parent region;. More...
 
bool isResidual
 A flag if this region should be explicitelly modelled or it is just a residual. More...
 
ModelRegionparRegion
 Pointer to the parent region. More...
 
vector< ModelRegion * > chRegions
 Vector of level-1 children regions. More...
 
vector< forData * > forDataVector
 Vector of pointers of forestry data (owned by ModelData) More...
 
vector< prodData * > prodDataVector
 Vector of pointers of product data (owned by ModelData) More...
 
vector< Pixel * > myPixels
 Vector of pixels for this region. More...
 

Additional Inherited Members

- Protected Attributes inherited from BaseClass
ThreadManagerMTHREAD
 Pointer to the Thread manager. More...
 

Detailed Description

Definition at line 45 of file ModelRegion.h.

Constructor & Destructor Documentation

ModelRegion ( ThreadManager MTHREAD_h,
int  regId_h,
string  regSName_h,
string  regLName_h,
int  regLevel_h,
int  parRegId_h,
bool  isResidual_h 
)

Constructor.

The constructor of REGION instances want:

Parameters
MTHREAD_hPointer to the main thread manager

Definition at line 34 of file ModelRegion.cpp.

34  {
35  MTHREAD=MTHREAD_h;
36  regId = regId_h;
37  regSName = regSName_h;
38  regLName = regLName_h;
39  regLevel = regLevel_h;
40  parRegId = parRegId_h;
41  isResidual = isResidual_h;
42 
43  // Create an empty vector of inventory bounds for each possible primary products combination
44  int nInBounds = pow(2,MTHREAD->MD->getStringVectorSetting("priProducts").size());
45  //int nInBounds = MTHREAD->MD->getStringVectorSetting("priProducts").size(); // TODO todo !Important
46  vector <double> inBounds(nInBounds,0.); // should have ceated a vector of size priProducts.size(), all filled with zeros
47  inResByAnyCombination = inBounds;
48  //inResByAnyCombination_deathTimber = inBounds;
49 }
int parRegId
Id of the parent region;.
Definition: ModelRegion.h:96
int regLevel
The level of the region. 1: country, 2: regions.
Definition: ModelRegion.h:95
ThreadManager * MTHREAD
Pointer to the Thread manager.
Definition: BaseClass.h:467
ModelData * MD
the model data object
Definition: ThreadManager.h:72
vector< string > getStringVectorSetting(const string &name_h, int reg=WORLD) const
Definition: ModelData.cpp:1129
vector< double > inResByAnyCombination
Vector of inventory resource for each possible combination of primary products. This store both alive...
Definition: ModelRegion.h:86
bool isResidual
A flag if this region should be explicitelly modelled or it is just a residual.
Definition: ModelRegion.h:97
int regId
Regional unique ID.
Definition: ModelRegion.h:92
string regLName
Region long name;.
Definition: ModelRegion.h:94
string regSName
A short name of the region.
Definition: ModelRegion.h:93

Here is the call graph for this function:

Definition at line 51 of file ModelRegion.cpp.

51  {
52 }

Member Function Documentation

void addForData ( forData *  data_h)
inline

Childrens are all the lvel-1 region that are parts of this region.

Definition at line 60 of file ModelRegion.h.

60 {forDataVector.push_back(data_h);};
vector< forData * > forDataVector
Vector of pointers of forestry data (owned by ModelData)
Definition: ModelRegion.h:100
void addProdData ( prodData *  data_h)
inline

Definition at line 61 of file ModelRegion.h.

61 {prodDataVector.push_back(data_h);};
vector< prodData * > prodDataVector
Vector of pointers of product data (owned by ModelData)
Definition: ModelRegion.h:101
double getArea ( const string &  fType_h,
const string &  dClass_h 
)

Get area by ft and dc (from pixel->area matrix)

Definition at line 125 of file ModelRegion.cpp.

Referenced by ModelCoreSpatial::runManagementModule().

125  {
126  vector <string> dClasses = MTHREAD->MD->getStringVectorSetting("dClasses");
127  vector <string> fTypes= MTHREAD->MD->getForTypeIds();
128  int ft_pos = -1000;
129  int dc_pos = -1000;
130  for(uint j=0;j<fTypes.size();j++){
131  if (fTypes[j] == fType_h){
132  ft_pos = j;
133  break;
134  }
135  }
136  for(uint u=0;u<dClasses.size();u++){
137  if (dClasses[u] == dClass_h){
138  dc_pos = u;
139  break;
140  }
141  }
142  if(ft_pos<0) msgOut(MSG_CRITICAL_ERROR,"Forest type "+fType_h+" not found in getArea() function.");
143  if(dc_pos<0) msgOut(MSG_CRITICAL_ERROR,"Diameter class"+dClass_h+" not found in getArea() function.");
144 
145  return getArea(ft_pos, dc_pos);
146 }
ThreadManager * MTHREAD
Pointer to the Thread manager.
Definition: BaseClass.h:467
ModelData * MD
the model data object
Definition: ThreadManager.h:72
void msgOut(const int &msgCode_h, const string &msg_h, const bool &refreshGUI_h=true) const
Overloaded function to print the output log.
Definition: BaseClass.cpp:50
vector< string > getStringVectorSetting(const string &name_h, int reg=WORLD) const
Definition: ModelData.cpp:1129
Print an error message and stop the model.
Definition: BaseClass.h:62
vector< string > getForTypeIds(bool all=false)
By default it doesn&#39;t return forTypes used only as input.
Definition: ModelData.cpp:430
double getArea()
Get whole forest area (from pixel->area matrix)

Here is the call graph for this function:

Here is the caller graph for this function:

double getArea ( const string &  fType_h)

Get area by ft (from pixel->area matrix)

Definition at line 149 of file ModelRegion.cpp.

149  {
150  vector <string> fTypes= MTHREAD->MD->getForTypeIds();
151  int ft_pos = -1000;
152  for(uint j=0;j<fTypes.size();j++){
153  if (fTypes[j] == fType_h){
154  ft_pos = j;
155  break;
156  }
157  }
158  if(ft_pos<0) msgOut(MSG_CRITICAL_ERROR,"Forest type "+fType_h+" not found in getArea() function.");
159  return getArea(ft_pos);
160 }
ThreadManager * MTHREAD
Pointer to the Thread manager.
Definition: BaseClass.h:467
ModelData * MD
the model data object
Definition: ThreadManager.h:72
void msgOut(const int &msgCode_h, const string &msg_h, const bool &refreshGUI_h=true) const
Overloaded function to print the output log.
Definition: BaseClass.cpp:50
Print an error message and stop the model.
Definition: BaseClass.h:62
vector< string > getForTypeIds(bool all=false)
By default it doesn&#39;t return forTypes used only as input.
Definition: ModelData.cpp:430
double getArea()
Get whole forest area (from pixel->area matrix)

Here is the call graph for this function:

double getArea ( const int &  ft_pos,
const int &  dc_pos 
)

Get area by ft and dc positions (from pixel->area matrix)

Definition at line 163 of file ModelRegion.cpp.

163  {
164  double totalarea = 0.0;
165  for(uint i=0;i<myPixels.size(); i++){
166  totalarea += myPixels[i]->area.at(ft_pos).at(dc_pos);
167  }
168  return totalarea;
169 }
vector< Pixel * > myPixels
Vector of pixels for this region.
Definition: ModelRegion.h:102
double getArea ( const int &  ft_pos)

Get area by ft position (from pixel->area matrix)

Definition at line 172 of file ModelRegion.cpp.

172  {
173  double totalarea = 0.0;
174  for(uint i=0;i<myPixels.size(); i++){
175  totalarea += vSum(myPixels[i]->area.at(ft_pos));
176  }
177  return totalarea;
178 }
int vSum(const vector< int > &vector_h) const
Definition: BaseClass.h:276
vector< Pixel * > myPixels
Vector of pixels for this region.
Definition: ModelRegion.h:102

Here is the call graph for this function:

double getArea ( )

Get whole forest area (from pixel->area matrix)

Definition at line 181 of file ModelRegion.cpp.

Referenced by getArea().

181  {
182  vector<Pixel*> regPx = this->getMyPixels();
183  double totalarea = 0.0;
184  for(uint i=0;i<myPixels.size(); i++){
185  totalarea += vSum(myPixels[i]->area);
186  }
187  return totalarea;
188 }
int vSum(const vector< int > &vector_h) const
Definition: BaseClass.h:276
vector< Pixel * > myPixels
Vector of pixels for this region.
Definition: ModelRegion.h:102
vector< Pixel * > getMyPixels()
Definition: ModelRegion.h:86

Here is the call graph for this function:

Here is the caller graph for this function:

vector< ModelRegion * > getChildren ( bool  excludeResidual = true)

Returns a pointer to the parent regions.

Return a vector of pointers to the direct child regions

Definition at line 55 of file ModelRegion.cpp.

Referenced by ModelData::applyOverrides(), Output::commonInit(), Opt::get_nlp_info(), getNChildren(), and ModelData::getRegionIds().

55  {
56  if(excludeResidual){
57  vector<ModelRegion*> toReturn;
58  for(uint i=0;i<chRegions.size();i++){
59  if(!chRegions[i]->getIsResidual()){
60  toReturn.push_back(chRegions[i]);
61  }
62  }
63  return toReturn;
64  }
65  return chRegions;
66 }
vector< ModelRegion * > chRegions
Vector of level-1 children regions.
Definition: ModelRegion.h:99
bool getIsResidual() const
Definition: ModelRegion.h:71

Here is the call graph for this function:

Here is the caller graph for this function:

bool getIsResidual ( ) const
inline

Definition at line 71 of file ModelRegion.h.

Referenced by getChildren().

71 {return isResidual;};
bool isResidual
A flag if this region should be explicitelly modelled or it is just a residual.
Definition: ModelRegion.h:97

Here is the caller graph for this function:

int getNChildren ( bool  excludeResidual = true)

Definition at line 69 of file ModelRegion.cpp.

Referenced by ModelData::applyOverrides(), ModelData::getForData(), ModelData::getProdData(), ModelData::setForData(), and ModelData::setProdData().

69  {
70  /*if(excludeResidual){
71  int toReturn = 0; // Bug found 20180927
72  for(uint i=0;i<chRegions.size();i++){
73  if(!chRegions[i]->getIsResidual()){
74  toReturn++;
75  }
76  }
77  return toReturn;
78  }
79  return chRegions.size();
80  */
81  return getChildren(excludeResidual).size();
82 }
vector< ModelRegion * > getChildren(bool excludeResidual=true)
Returns a pointer to the parent regions.
Definition: ModelRegion.cpp:55

Here is the call graph for this function:

Here is the caller graph for this function:

ModelRegion* getParent ( )
inline

Definition at line 72 of file ModelRegion.h.

Referenced by Pixel::getMyRegion().

72 {return parRegion;}; ///< Returns a pointer to the parent regions
ModelRegion * parRegion
Pointer to the parent region.
Definition: ModelRegion.h:98

Here is the caller graph for this function:

int getParRegId ( ) const
inline

Definition at line 70 of file ModelRegion.h.

70 {return parRegId;};
int parRegId
Id of the parent region;.
Definition: ModelRegion.h:96
int getRegId ( ) const
inline

Definition at line 66 of file ModelRegion.h.

Referenced by Pixel::getMultiplier(), and getSiblings().

66 {return regId;};
int regId
Regional unique ID.
Definition: ModelRegion.h:92

Here is the caller graph for this function:

int getRegLevel ( ) const
inline

Definition at line 69 of file ModelRegion.h.

69 {return regLevel;};
int regLevel
The level of the region. 1: country, 2: regions.
Definition: ModelRegion.h:95
string getRegLName ( ) const
inline

Definition at line 68 of file ModelRegion.h.

68 {return regLName;};
string regLName
Region long name;.
Definition: ModelRegion.h:94
string getRegSName ( ) const
inline

Definition at line 67 of file ModelRegion.h.

Referenced by ModelData::regId2RegSName(), ModelData::regSName2RegId(), and ModelCoreSpatial::runBiologicalModule().

67 {return regSName;};
string regSName
A short name of the region.
Definition: ModelRegion.h:93

Here is the caller graph for this function:

vector< ModelRegion * > getSiblings ( bool  excludeResidual = true)

Return a vector of pointers to the siblings regions.

Definition at line 85 of file ModelRegion.cpp.

Referenced by ModelCoreSpatial::computeEconomicBalances().

85  {
86  vector<ModelRegion*> toReturn;
87  vector<ModelRegion*> allRegions = MTHREAD->MD->getAllRegions(excludeResidual);
88  for (uint i=0;i<allRegions.size();i++){
89  if (allRegions[i]->parRegId == parRegId && allRegions[i]->getRegId() != regId){
90  toReturn.push_back(allRegions[i]);
91  }
92  }
93  return toReturn;
94 }
int parRegId
Id of the parent region;.
Definition: ModelRegion.h:96
int getRegId() const
Definition: ModelRegion.h:66
ThreadManager * MTHREAD
Pointer to the Thread manager.
Definition: BaseClass.h:467
ModelData * MD
the model data object
Definition: ThreadManager.h:72
int regId
Regional unique ID.
Definition: ModelRegion.h:92
vector< ModelRegion * > getAllRegions(bool excludeResidual=true)
Definition: ModelData.cpp:379

Here is the call graph for this function:

Here is the caller graph for this function:

double getValue ( string  layerName,
int  op = OP_SUM 
)

return the values of its own pixels for the specified layer. Possible operations: OP_SUM or OP_AVG

Definition at line 191 of file ModelRegion.cpp.

Referenced by ModelCoreSpatial::initializePixelArea(), ModelCoreSpatial::initializePixelVolumes(), ModelCoreSpatial::runBiologicalModule(), and ModelCore::updateMapAreas().

191  {
192  int nPx = myPixels.size();
193  double sumvalue=0;
194  for(uint i=0;i<nPx; i++){
195  sumvalue += myPixels[i]->getDoubleValue(layerName,true);
196  }
197  if(op==OP_SUM){
198  return sumvalue;
199  } else if (op == OP_AVG) {
200  return sumvalue/nPx;
201  } else {
202  string thisf = __PRETTY_FUNCTION__;
203  msgOut(MSG_CRITICAL_ERROR, "in "+thisf+", operation not supported");
204  }
205  return 0.;
206 }
void msgOut(const int &msgCode_h, const string &msg_h, const bool &refreshGUI_h=true) const
Overloaded function to print the output log.
Definition: BaseClass.cpp:50
Perform a SUM operation.
Definition: BaseClass.h:77
Print an error message and stop the model.
Definition: BaseClass.h:62
vector< Pixel * > myPixels
Vector of pixels for this region.
Definition: ModelRegion.h:102
Perform an AVERAGE operation.
Definition: BaseClass.h:78

Here is the call graph for this function:

Here is the caller graph for this function:

double getVolumes ( )
Todo:
Implement me (but really needed?)

Definition at line 104 of file ModelRegion.cpp.

104  {
105  /// \todo Implement me (but really needed?)
106  return 0;
107 }
vector< double > getVolumes ( int  fType_h)
Todo:
Implement me (but really needed?)

Definition at line 110 of file ModelRegion.cpp.

110  {
111  /// \todo Implement me (but really needed?)
112  vector<double> toReturn;
113  return toReturn;
114 }
vector< vector< double > > getVolumes ( int  fType_h,
string  dClass_h 
)
Todo:
Implement me (but really needed?)

Definition at line 117 of file ModelRegion.cpp.

117  {
118  /// \todo Implement me (but really needed?)
119  vector < vector <double> > toReturn;
120  return toReturn;
121 }
void setChildren ( vector< ModelRegion * >  children_h)
inline

Definition at line 59 of file ModelRegion.h.

59 {chRegions = children_h;}; ///< Childrens are all the lvel-1 region that are parts of this region.
vector< ModelRegion * > chRegions
Vector of level-1 children regions.
Definition: ModelRegion.h:99
void setIsResidual ( bool  isResidual_h)
inline

Definition at line 57 of file ModelRegion.h.

57 {isResidual = isResidual_h;};
bool isResidual
A flag if this region should be explicitelly modelled or it is just a residual.
Definition: ModelRegion.h:97
void setMyPixels ( )

It sets a double link pixels <–> region.

Definition at line 215 of file ModelRegion.cpp.

215  {
216  int xyNPixels = MTHREAD->GIS->getXyNPixels();
217  for(uint i=0;i<xyNPixels;i++){
218  Pixel* px = MTHREAD->GIS->getPixel(i);
219  if(px->getDoubleValue("regLev_1")==regId || px->getDoubleValue("regLev_2")==regId){
220  myPixels.push_back(px);
221  if(regLevel == 2){
222  px->setMyRegion(this);
223  }
224  }
225  }
226 }
void setMyRegion(ModelRegion *region_h)
Definition: Pixel.h:90
int regLevel
The level of the region. 1: country, 2: regions.
Definition: ModelRegion.h:95
ThreadManager * MTHREAD
Pointer to the Thread manager.
Definition: BaseClass.h:467
double getXyNPixels() const
Return the number of pixels on Y.
Definition: Gis.h:131
Gis * GIS
GIS information and methods.
Definition: ThreadManager.h:73
double getDoubleValue(const string &layerName_h, const bool &returnZeroForNoValue=false) const
Return the value for a specific layer.
Definition: Pixel.cpp:158
int regId
Regional unique ID.
Definition: ModelRegion.h:92
Pixel-level class.
Definition: Pixel.h:47
Pixel * getPixel(int x_h, int y_h)
Definition: Gis.h:134
vector< Pixel * > myPixels
Vector of pixels for this region.
Definition: ModelRegion.h:102

Here is the call graph for this function:

void setParent ( ModelRegion parRegion_h)
inline

Definition at line 58 of file ModelRegion.h.

58 {parRegion = parRegion_h;};
ModelRegion * parRegion
Pointer to the parent region.
Definition: ModelRegion.h:98
void setParRegId ( int  parRegId_h)
inline

Definition at line 56 of file ModelRegion.h.

56 {parRegId = parRegId_h;};
int parRegId
Id of the parent region;.
Definition: ModelRegion.h:96
void setRegId ( int  regId_h)
inline

Definition at line 52 of file ModelRegion.h.

52 {regId = regId_h;};
int regId
Regional unique ID.
Definition: ModelRegion.h:92
void setRegLevel ( int  regLevel_h)
inline

Definition at line 55 of file ModelRegion.h.

55 {regLevel = regLevel_h;};
int regLevel
The level of the region. 1: country, 2: regions.
Definition: ModelRegion.h:95
void setRegLName ( string  regLName_h)
inline

Definition at line 54 of file ModelRegion.h.

54 {regLName = regLName_h;};
string regLName
Region long name;.
Definition: ModelRegion.h:94
void setRegSName ( string  regSName_h)
inline

Definition at line 53 of file ModelRegion.h.

53 {regSName = regSName_h;};
string regSName
A short name of the region.
Definition: ModelRegion.h:93
void swap ( const int &  swap_what)

Definition at line 229 of file ModelRegion.cpp.

229  {
230 
231  for(uint i=0;i<myPixels.size();i++) {
232  myPixels[i]->swap(swap_what);
233  }
234 
235 }
vector< Pixel * > myPixels
Vector of pixels for this region.
Definition: ModelRegion.h:102

Member Data Documentation

vector<ModelRegion*> chRegions
private

Vector of level-1 children regions.

Definition at line 99 of file ModelRegion.h.

Referenced by getChildren().

vector<forData*> forDataVector
private

Vector of pointers of forestry data (owned by ModelData)

Definition at line 100 of file ModelRegion.h.

vector<double> inResByAnyCombination

Vector of inventory resource for each possible combination of primary products. This store both alive timber and death one.

Definition at line 86 of file ModelRegion.h.

Referenced by ModelCoreSpatial::computeInventary(), Opt::copyInventoryResourses(), ModelRegion(), and ModelCoreSpatial::runMarketModule().

bool isResidual
private

A flag if this region should be explicitelly modelled or it is just a residual.

Definition at line 97 of file ModelRegion.h.

Referenced by ModelRegion().

vector<Pixel*> myPixels
private

Vector of pixels for this region.

Definition at line 102 of file ModelRegion.h.

Referenced by getArea(), getValue(), setMyPixels(), and swap().

int parRegId
private

Id of the parent region;.

Definition at line 96 of file ModelRegion.h.

Referenced by getSiblings(), and ModelRegion().

ModelRegion* parRegion
private

Pointer to the parent region.

Definition at line 98 of file ModelRegion.h.

vector<prodData*> prodDataVector
private

Vector of pointers of product data (owned by ModelData)

Definition at line 101 of file ModelRegion.h.

int regId
private

Regional unique ID.

Definition at line 92 of file ModelRegion.h.

Referenced by getSiblings(), ModelRegion(), and setMyPixels().

int regLevel
private

The level of the region. 1: country, 2: regions.

Definition at line 95 of file ModelRegion.h.

Referenced by ModelRegion(), and setMyPixels().

string regLName
private

Region long name;.

Definition at line 94 of file ModelRegion.h.

Referenced by ModelRegion().

string regSName
private

A short name of the region.

Definition at line 93 of file ModelRegion.h.

Referenced by ModelRegion().


The documentation for this class was generated from the following files: