22 #ifndef MODELCORESPATIAL_H 23 #define MODELCORESPATIAL_H 112 double computeExpectedPrice(
const double & curLocPrice,
const double & worldCurPrice,
const double & worldFutPrice,
const double & sl,
const double & sa,
const double & expCoef);
120 double getVHaByYear (
const Pixel* px,
const int& ft,
const int& year,
const double& extraBiomass_ratio,
const int& regId )
const;
123 double gpd(
const string &type_h,
const int& regId_h,
const string &prodId_h,
const int& year=
DATA_NOW,
const string &freeDim_h=
"")
const {
return MTHREAD->
MD->
getProdData(type_h, regId_h, prodId_h, year, freeDim_h);};
124 double gfd(
const string &type_h,
const int& regId_h,
const string &forType_h,
const string &freeDim_h,
const int& year=
DATA_NOW)
const {
return MTHREAD->
MD->
getForData(type_h, regId_h, forType_h, freeDim_h, year);};
125 void spd(
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=
"")
const {
MTHREAD->
MD->
setProdData(value_h, type_h, regId_h, prodId_h, year, allowCreate, freeDim_h);};
126 void sfd(
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)
const {
MTHREAD->
MD->
setForData(value_h, type_h, regId_h, forType_h, freeDim_h, year, allowCreate);};
142 vector <vector <int> >
l2r;
153 #endif // MODELCORESPATIAL_H
The required data is for the current year.
void runBiologicalModule()
computes hV, hArea and new vol at end of year
vector< vector< int > > l2r
vector< string > dClasses
void runManagementModule()
computes regArea and expectedReturns
void initializePixelVolumes()
distribuite regional exogenous volumes to pixel volumes using corine land cover area as weight ...
void sumRegionalForData()
computes vol, hV, harvestedArea, regArea and expReturns at reg level from the pixel level ...
void spd(const double &value_h, const string &type_h, const int ®Id_h, const string &prodId_h, const int &year=DATA_NOW, const bool &allowCreate=false, const string &freeDim_h="") const
ThreadManager * MTHREAD
Pointer to the Thread manager.
ModelData * MD
the model data object
void loadExogenousForestLayers(const string &what)
Set pixel volumes (what="vol") OR areas (what="area") by specific forest types as defined in gis laye...
vector< string > priProducts
string forestAreaChangeMethod
Thread manager. Responsable to manage the main thread and "speak" with the GUI.
void resetPixelValues()
swap volumes->lagged_volumes and reset the other pixel vectors
vector< string > pDClasses
void computeInventary()
in=f(vol_t-1)
Regional data, including macros and settings.
const double getProdData(const string &type_h, const int ®Id_h, const string &prodId_h, const int &year=DATA_NOW, const string &freeDim_h="")
void runMarketModule()
computes st (supply total) and pw (weighted price). Optimisation inside.
void cacheSettings()
just cache exogenous settings from ModelData
const double getForData(const string &type_h, const int ®Id_h, const string &forType_h, const string &freeDim_h, const int &year=DATA_NOW)
void setProdData(const double &value_h, const string &type_h, const int ®Id_h, const string &prodId_h, const int &year=DATA_NOW, const bool &allowCreate=false, const string &freeDim_h="")
void updateOtherMapData()
update (if the layer exists) other gis-based data, as volumes and expected returns, taking them from the data in the px object
void initialiseDeathTimber()
Set deathTimberInventory to zero for the previous years (under the hipotesis that we don't have advan...
double getVHaByYear(const Pixel *px, const int &ft, const int &year, const double &extraBiomass_ratio, const int ®Id) const
return the Volume/ha in a forest after a given number of year after planting, for a specific forest t...
vector< string > allProducts
vector< string > secProducts
double gpd(const string &type_h, const int ®Id_h, const string &prodId_h, const int &year=DATA_NOW, const string &freeDim_h="") const
Base class for the regmas application.
ModelCoreSpatial(ThreadManager *MTHREAD_h)
double getAvgAgeByDc(Pixel *px, int ft, int dc)
return the average age of a tree at a given diameter class, using the cumTp vector ...
void initMarketModule()
computes st and pw for second year and several needed-only-at-t0-vars for the market module ...
double computeExpectedPrice(const double &curLocPrice, const double &worldCurPrice, const double &worldFutPrice, const double &sl, const double &sa, const double &expCoef)
Compute weighted expected price for a given product.
void initializePixelArea()
compute px->area for each ft and dc
void sfd(const double &value_h, const string &type_h, const int ®Id_h, const string &forType_h, const string &freeDim_h, const int &year=DATA_NOW, const bool &allowCreate=false) const
void setForData(const double &value_h, const string &type_h, const int ®Id_h, const string &forType_h, const string &freeDim_h, const int &year=DATA_NOW, const bool &allowCreate=false)
double gfd(const string &type_h, const int ®Id_h, const string &forType_h, const string &freeDim_h, const int &year=DATA_NOW) const
bool app(const string &prod_h, const string &forType_h, const string &dClass_h) const
The core of the model (spatial version).
void assignSpMultiplierPropToVols()
ModelCoreSpatial::assignSpMultiplierPropToVols assigns the spatial multiplier (used in the time of re...
void cacheDynamicSettings()
cache settings that may change with time
void initialiseCarbonModule()
call initialiseDeathBiomassStocks(), initialiseProductsStocks() and initialiseEmissionCounters() ...
void cachePixelExogenousData()
computes pixel level tp, meta and mort
This file is the header of BaseClass and it is included by ALL compiled code.
void updateMapAreas()
computes forArea_{ft}
void registerCarbonEvents()
call registerHarvesting(), registerDeathBiomass(), registerProducts() and registerTransports() ...
const bool assessProdPossibility(const string &prod_h, const string &forType_h, const string &dClass_h)
A simple function to assess if a specified product can be made by a certain forest type and diameter ...
void computeCumulativeData()
computes cumTp_exp, vHa_exp, vHa
void printDebugInitRegionalValues()
print initial inv, st, sl and sa in each region
void computeEconomicBalances()
compute the policy balances (- -> costs; + -> rev) and the producer/consumer surpluses ...
vector< double > allocateHarvesting(vector< double > total_st, const int ®Id)
Using the deathTimberInventory map, this function allocate the total st in st from death timber (that...