Rev 1221 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1033 | werner | 1 | /******************************************************************************************** |
2 | ** iLand - an individual based forest landscape and disturbance model |
||
3 | ** http://iland.boku.ac.at |
||
4 | ** Copyright (C) 2009- Werner Rammer, Rupert Seidl |
||
5 | ** |
||
6 | ** This program is free software: you can redistribute it and/or modify |
||
7 | ** it under the terms of the GNU General Public License as published by |
||
8 | ** the Free Software Foundation, either version 3 of the License, or |
||
9 | ** (at your option) any later version. |
||
10 | ** |
||
11 | ** This program is distributed in the hope that it will be useful, |
||
12 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
||
13 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||
14 | ** GNU General Public License for more details. |
||
15 | ** |
||
16 | ** You should have received a copy of the GNU General Public License |
||
17 | ** along with this program. If not, see <http://www.gnu.org/licenses/>. |
||
18 | ********************************************************************************************/ |
||
19 | |||
187 | iland | 20 | #ifndef RESOURCEUNITSPECIES_H |
21 | #define RESOURCEUNITSPECIES_H |
||
115 | Werner | 22 | #include "production3pg.h" |
180 | werner | 23 | #include "standstatistics.h" |
193 | werner | 24 | #include "speciesresponse.h" |
440 | werner | 25 | #include "establishment.h" |
1113 | werner | 26 | #include "saplings.h" |
453 | werner | 27 | #include "grid.h" |
475 | werner | 28 | #include "snag.h" |
111 | Werner | 29 | class Species; |
187 | iland | 30 | class ResourceUnit; |
111 | Werner | 31 | |
1113 | werner | 32 | |
187 | iland | 33 | class ResourceUnitSpecies |
111 | Werner | 34 | { |
35 | public: |
||
521 | werner | 36 | ResourceUnitSpecies() : mLAIfactor(0.), mSpecies(0), mRU(0) {} |
468 | werner | 37 | ~ResourceUnitSpecies(); |
234 | werner | 38 | void setup(Species *species, ResourceUnit *ru); |
115 | Werner | 39 | |
449 | werner | 40 | // access |
209 | werner | 41 | const SpeciesResponse *speciesResponse() const { return &mResponse; } |
208 | werner | 42 | const Species *species() const { return mSpecies; } ///< return pointer to species |
43 | const ResourceUnit *ru() const { return mRU; } ///< return pointer to resource unit |
||
228 | werner | 44 | const Production3PG &prod3PG() const { return m3PG; } ///< the 3pg production model of this speies x resourceunit |
1113 | werner | 45 | |
46 | SaplingStat &saplingStat() { return mSaplingStat; } ///< statistics for the sapling sub module |
||
1174 | werner | 47 | const SaplingStat &constSaplingStat() const { return mSaplingStat; } ///< statistics for the sapling sub module |
1113 | werner | 48 | |
1111 | werner | 49 | Establishment &establishment() { return mEstablishment; } ///< establishment submodel |
208 | werner | 50 | StandStatistics &statistics() { return mStatistics; } ///< statistics of this species on the resourceunit |
278 | werner | 51 | StandStatistics &statisticsDead() { return mStatisticsDead; } ///< statistics of died trees |
52 | StandStatistics &statisticsMgmt() { return mStatisticsMgmt; } ///< statistics of removed trees |
||
262 | werner | 53 | const StandStatistics &constStatistics() const { return mStatistics; } ///< const accessor |
54 | const StandStatistics &constStatisticsDead() const { return mStatisticsDead; } ///< const accessor |
||
278 | werner | 55 | const StandStatistics &constStatisticsMgmt() const { return mStatisticsMgmt; } ///< const accessor |
56 | |||
449 | werner | 57 | // actions |
277 | werner | 58 | void updateGWL(); |
936 | werner | 59 | double removedVolume() const { return mRemovedGrowth; } ///< sum of volume with was remvoved because of death/management (m3/ha) |
720 | werner | 60 | /// relative fraction of LAI of this species (0..1) (if total LAI on resource unit is >= 1, then the sum of all LAIfactors of all species = 1) |
61 | double LAIfactor() const { return mLAIfactor; } |
||
937 | werner | 62 | void setLAIfactor(const double newLAIfraction) { mLAIfactor=newLAIfraction; |
63 | if (mLAIfactor<0 || mLAIfactor>1.00001) |
||
64 | qDebug() << "invalid LAIfactor"<<mLAIfactor; } |
||
376 | werner | 65 | // properties |
66 | double leafArea() const; ///< total leaf area of the species on the RU (m2). |
||
115 | Werner | 67 | // action |
440 | werner | 68 | void calculate(const bool fromEstablishment=false); ///< calculate response for species, calculate actual 3PG production |
115 | Werner | 69 | |
111 | Werner | 70 | private: |
454 | werner | 71 | ResourceUnitSpecies(const ResourceUnitSpecies &); // no copy |
72 | ResourceUnitSpecies &operator=(const ResourceUnitSpecies &); // no copy |
||
376 | werner | 73 | double mLAIfactor; ///< relative amount of this species' LAI on this resource unit (0..1). Is calculated once a year. |
936 | werner | 74 | double mRemovedGrowth; ///< m3 volume of trees removed/managed (to calculate GWL) (m3/ha) |
262 | werner | 75 | StandStatistics mStatistics; ///< statistics of a species on this resource unit |
76 | StandStatistics mStatisticsDead; ///< statistics of died trees (this year) of a species on this resource unit |
||
278 | werner | 77 | StandStatistics mStatisticsMgmt; ///< statistics of removed trees (this year) of a species on this resource unit |
234 | werner | 78 | Production3PG m3PG; ///< NPP prodution unit of this species |
79 | SpeciesResponse mResponse; ///< calculation and storage of species specific respones on this resource unit |
||
440 | werner | 80 | Establishment mEstablishment; ///< establishment for seedlings and sapling growth |
1113 | werner | 81 | SaplingStat mSaplingStat; ///< statistics on saplings |
468 | werner | 82 | Species *mSpecies; ///< link to speices |
83 | ResourceUnit *mRU; ///< link to resource unit |
||
438 | werner | 84 | int mLastYear; |
111 | Werner | 85 | }; |
86 | |||
87 | #endif // RESSOURCEUNITSPECIES_H |