Rev 685 | Rev 824 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 685 | Rev 779 | ||
---|---|---|---|
1 | Redirecting to URL 'https://iland.boku.ac.at/svn/iland/tags/release_1.0/src/core/establishment.h': |
1 | Redirecting to URL 'https://iland.boku.ac.at/svn/iland/tags/release_1.0/src/core/establishment.h': |
2 | /********************************************************************************************
|
2 | /********************************************************************************************
|
3 | ** iLand - an individual based forest landscape and disturbance model
|
3 | ** iLand - an individual based forest landscape and disturbance model
|
4 | ** http://iland.boku.ac.at
|
4 | ** http://iland.boku.ac.at
|
5 | ** Copyright (C) 2009- Werner Rammer, Rupert Seidl
|
5 | ** Copyright (C) 2009- Werner Rammer, Rupert Seidl
|
6 | **
|
6 | **
|
7 | ** This program is free software: you can redistribute it and/or modify
|
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
|
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
|
9 | ** the Free Software Foundation, either version 3 of the License, or
|
10 | ** (at your option) any later version.
|
10 | ** (at your option) any later version.
|
11 | **
|
11 | **
|
12 | ** This program is distributed in the hope that it will be useful,
|
12 | ** This program is distributed in the hope that it will be useful,
|
13 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
15 | ** GNU General Public License for more details.
|
15 | ** GNU General Public License for more details.
|
16 | **
|
16 | **
|
17 | ** You should have received a copy of the GNU General Public License
|
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/>.
|
18 | ** along with this program. If not, see <http://www.gnu.org/licenses/>.
|
19 | ********************************************************************************************/
|
19 | ********************************************************************************************/
|
20 | 20 | ||
21 | #ifndef ESTABLISHMENT_H
|
21 | #ifndef ESTABLISHMENT_H
|
22 | #define ESTABLISHMENT_H
|
22 | #define ESTABLISHMENT_H
|
23 | #include <QtCore/QPoint>
|
23 | #include <QtCore/QPoint>
|
24 | class Climate; |
24 | class Climate; |
25 | class ResourceUnitSpecies; |
25 | class ResourceUnitSpecies; |
26 | 26 | ||
27 | class Establishment
|
27 | class Establishment
|
28 | {
|
28 | {
|
29 | public: |
29 | public: |
30 | Establishment(); |
30 | Establishment(); |
31 | Establishment(const Climate *climate, const ResourceUnitSpecies *rus); |
31 | Establishment(const Climate *climate, const ResourceUnitSpecies *rus); |
32 | /// setup function that links to a climate and the resource unit / species
|
32 | /// setup function that links to a climate and the resource unit / species
|
33 | void setup(const Climate *climate, const ResourceUnitSpecies *rus); |
33 | void setup(const Climate *climate, const ResourceUnitSpecies *rus); |
34 | /// main function "calculate()": process the establishment routine
|
34 | /// main function "calculate()": process the establishment routine
|
35 | void calculate(); |
35 | void calculate(); |
36 | // some informations after execution
|
36 | // some informations after execution
|
37 | double avgSeedDensity() const { return mPxDensity;} ///< average seed density on the RU |
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) |
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 |
39 | int numberEstablished() const { return mNumberEstablished; } ///< return number of newly established trees in the current year |
40 | bool TACAminTemp() const { return mTACA_min_temp;} ///< TACA flag for minimum temperature |
40 | bool TACAminTemp() const { return mTACA_min_temp;} ///< TACA flag for minimum temperature |
41 | bool TACAchill() const { return mTACA_chill;} ///< TACA flag chilling requirement |
41 | bool TACAchill() const { return mTACA_chill;} ///< TACA flag chilling requirement |
42 | bool TACgdd() const { return mTACA_gdd;} ///< TACA flag for growing degree days |
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 |
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 |
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 |
45 | double avgLIFValue() const { return mLIFcount>0?mSumLIFvalue/double(mLIFcount):0.; } ///< average LIF value of LIF pixels where establishment is tested |
46 | 46 | ||
47 | 47 | ||
48 | private: |
48 | private: |
49 | double mPAbiotic; ///< abiotic probability for establishment (climate) |
49 | double mPAbiotic; ///< abiotic probability for establishment (climate) |
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 |
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 |
51 | void calculateAbioticEnvironment(); ///< calculate the abiotic environment (TACA model) |
51 | void calculateAbioticEnvironment(); ///< calculate the abiotic environment (TACA model) |
52 | const Climate *mClimate; ///< link to the current climate |
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) |
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 |
54 | double mRegenerationProbability; ///< prob. of regeneration in the current year |
55 | // some statistics
|
55 | // some statistics
|
56 | double mPxDensity; |
56 | double mPxDensity; |
57 | int mNumberEstablished; // number of established trees in the current year |
57 | int mNumberEstablished; // number of established trees in the current year |
58 | // TACA switches
|
58 | // TACA switches
|
59 | bool mTACA_min_temp; // minimum temperature threshold |
59 | bool mTACA_min_temp; // minimum temperature threshold |
60 | bool mTACA_chill; // (total) chilling requirement |
60 | bool mTACA_chill; // (total) chilling requirement |
61 | bool mTACA_gdd; // gdd-thresholds |
61 | bool mTACA_gdd; // gdd-thresholds |
62 | bool mTACA_frostfree; // frost free days in vegetation period |
62 | bool mTACA_frostfree; // frost free days in vegetation period |
63 | int mTACA_frostAfterBuds; // frost days after bud birst |
63 | int mTACA_frostAfterBuds; // frost days after bud birst |
64 | double mSumLIFvalue; |
64 | double mSumLIFvalue; |
65 | int mLIFcount; |
65 | int mLIFcount; |
66 | 66 | ||
67 | }; |
67 | }; |
68 | 68 | ||
69 | #endif // ESTABLISHMENT_H
|
69 | #endif // ESTABLISHMENT_H
|
70 | 70 |