Rev 624 | Rev 671 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1 | |||
434 | werner | 2 | #ifndef ESTABLISHMENT_H |
3 | #define ESTABLISHMENT_H |
||
439 | werner | 4 | #include <QtCore/QPoint> |
434 | werner | 5 | class Climate; |
6 | class ResourceUnitSpecies; |
||
443 | werner | 7 | |
434 | werner | 8 | class Establishment |
9 | { |
||
10 | public: |
||
440 | werner | 11 | Establishment(); |
434 | werner | 12 | Establishment(const Climate *climate, const ResourceUnitSpecies *rus); |
440 | werner | 13 | /// setup function that links to a climate and the resource unit / species |
14 | void setup(const Climate *climate, const ResourceUnitSpecies *rus); |
||
15 | /// main function "calculate()": process the establishment routine |
||
434 | werner | 16 | void calculate(); |
440 | werner | 17 | // some informations after execution |
18 | double avgSeedDensity() const { return mPxDensity;} ///< average seed density on the RU |
||
19 | double abioticEnvironment() const {return mPAbiotic; } ///< integrated value of abiotic environment (i.e.: TACA-climate + total iLand environment) |
||
20 | int numberEstablished() const { return mNumberEstablished; } ///< return number of newly established trees in the current year |
||
442 | werner | 21 | bool TACAminTemp() const { return mTACA_min_temp;} ///< TACA flag for minimum temperature |
22 | bool TACAchill() const { return mTACA_chill;} ///< TACA flag chilling requirement |
||
23 | bool TACgdd() const { return mTACA_gdd;} ///< TACA flag for growing degree days |
||
24 | bool TACAfrostFree() const { return mTACA_frostfree;} ///< TACA flag for number of frost free days |
||
25 | int TACAfrostDaysAfterBudBirst() const { return mTACA_frostAfterBuds; } ///< number of frost days after bud birst |
||
26 | double avgLIFValue() const { return mLIFcount>0?mSumLIFvalue/double(mLIFcount):0.; } ///< average LIF value of LIF pixels where establishment is tested |
||
440 | werner | 27 | |
442 | werner | 28 | |
434 | werner | 29 | private: |
30 | double mPAbiotic; ///< abiotic probability for establishment (climate) |
||
624 | werner | 31 | inline bool establishTree(const QPoint &pos_lif, const float lif_value, const float seed_value, const double &rnd_number); ///< do the final check whether a seedling can establish at given location |
434 | werner | 32 | void calculateAbioticEnvironment(); ///< calculate the abiotic environment (TACA model) |
33 | const Climate *mClimate; ///< link to the current climate |
||
34 | const ResourceUnitSpecies *mRUS; ///< link to the resource unit species (links to production data and species respones) |
||
35 | double mRegenerationProbability; ///< prob. of regeneration in the current year |
||
440 | werner | 36 | // some statistics |
37 | double mPxDensity; |
||
442 | werner | 38 | int mNumberEstablished; // number of established trees in the current year |
39 | // TACA switches |
||
40 | bool mTACA_min_temp; // minimum temperature threshold |
||
41 | bool mTACA_chill; // (total) chilling requirement |
||
42 | bool mTACA_gdd; // gdd-thresholds |
||
43 | bool mTACA_frostfree; // frost free days in vegetation period |
||
44 | int mTACA_frostAfterBuds; // frost days after bud birst |
||
45 | double mSumLIFvalue; |
||
46 | int mLIFcount; |
||
47 | |||
434 | werner | 48 | }; |
49 | |||
50 | #endif // ESTABLISHMENT_H |