Rev 685 | Rev 824 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1 | |||
671 | werner | 2 | /******************************************************************************************** |
3 | ** iLand - an individual based forest landscape and disturbance model |
||
4 | ** http://iland.boku.ac.at |
||
5 | ** Copyright (C) 2009- Werner Rammer, Rupert Seidl |
||
6 | ** |
||
7 | ** This program is free software: you can redistribute it and/or modify |
||
8 | ** it under the terms of the GNU General Public License as published by |
||
9 | ** the Free Software Foundation, either version 3 of the License, or |
||
10 | ** (at your option) any later version. |
||
11 | ** |
||
12 | ** This program is distributed in the hope that it will be useful, |
||
13 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
||
14 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||
15 | ** GNU General Public License for more details. |
||
16 | ** |
||
17 | ** You should have received a copy of the GNU General Public License |
||
18 | ** along with this program. If not, see <http://www.gnu.org/licenses/>. |
||
19 | ********************************************************************************************/ |
||
20 | |||
434 | werner | 21 | #ifndef ESTABLISHMENT_H |
22 | #define ESTABLISHMENT_H |
||
439 | werner | 23 | #include <QtCore/QPoint> |
434 | werner | 24 | class Climate; |
25 | class ResourceUnitSpecies; |
||
443 | werner | 26 | |
434 | werner | 27 | class Establishment |
28 | { |
||
29 | public: |
||
440 | werner | 30 | Establishment(); |
434 | werner | 31 | Establishment(const Climate *climate, const ResourceUnitSpecies *rus); |
440 | werner | 32 | /// setup function that links to a climate and the resource unit / species |
33 | void setup(const Climate *climate, const ResourceUnitSpecies *rus); |
||
34 | /// main function "calculate()": process the establishment routine |
||
434 | werner | 35 | void calculate(); |
440 | werner | 36 | // some informations after execution |
37 | double avgSeedDensity() const { return mPxDensity;} ///< average seed density on the RU |
||
38 | double abioticEnvironment() const {return mPAbiotic; } ///< integrated value of abiotic environment (i.e.: TACA-climate + total iLand environment) |
||
39 | int numberEstablished() const { return mNumberEstablished; } ///< return number of newly established trees in the current year |
||
442 | werner | 40 | bool TACAminTemp() const { return mTACA_min_temp;} ///< TACA flag for minimum temperature |
41 | bool TACAchill() const { return mTACA_chill;} ///< TACA flag chilling requirement |
||
42 | bool TACgdd() const { return mTACA_gdd;} ///< TACA flag for growing degree days |
||
43 | bool TACAfrostFree() const { return mTACA_frostfree;} ///< TACA flag for number of frost free days |
||
44 | int TACAfrostDaysAfterBudBirst() const { return mTACA_frostAfterBuds; } ///< number of frost days after bud birst |
||
45 | double avgLIFValue() const { return mLIFcount>0?mSumLIFvalue/double(mLIFcount):0.; } ///< average LIF value of LIF pixels where establishment is tested |
||
440 | werner | 46 | |
442 | werner | 47 | |
434 | werner | 48 | private: |
49 | double mPAbiotic; ///< abiotic probability for establishment (climate) |
||
685 | werner | 50 | inline bool establishTree(const QPoint &pos_lif, const float lif_value, const float seed_value); ///< do the final check whether a seedling can establish at given location |
434 | werner | 51 | void calculateAbioticEnvironment(); ///< calculate the abiotic environment (TACA model) |
52 | const Climate *mClimate; ///< link to the current climate |
||
53 | const ResourceUnitSpecies *mRUS; ///< link to the resource unit species (links to production data and species respones) |
||
54 | double mRegenerationProbability; ///< prob. of regeneration in the current year |
||
440 | werner | 55 | // some statistics |
56 | double mPxDensity; |
||
442 | werner | 57 | int mNumberEstablished; // number of established trees in the current year |
58 | // TACA switches |
||
59 | bool mTACA_min_temp; // minimum temperature threshold |
||
60 | bool mTACA_chill; // (total) chilling requirement |
||
61 | bool mTACA_gdd; // gdd-thresholds |
||
62 | bool mTACA_frostfree; // frost free days in vegetation period |
||
63 | int mTACA_frostAfterBuds; // frost days after bud birst |
||
64 | double mSumLIFvalue; |
||
65 | int mLIFcount; |
||
66 | |||
434 | werner | 67 | }; |
68 | |||
69 | #endif // ESTABLISHMENT_H |