Subversion Repositories public iLand

Rev

Rev 440 | Rev 450 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 440 Rev 449
1
Redirecting to URL 'https://iland.boku.ac.at/svn/iland/tags/release_1.0/src/core/resourceunitspecies.h':
1
Redirecting to URL 'https://iland.boku.ac.at/svn/iland/tags/release_1.0/src/core/resourceunitspecies.h':
2
#ifndef RESOURCEUNITSPECIES_H
2
#ifndef RESOURCEUNITSPECIES_H
3
#define RESOURCEUNITSPECIES_H
3
#define RESOURCEUNITSPECIES_H
4
#include "production3pg.h"
4
#include "production3pg.h"
5
#include "standstatistics.h"
5
#include "standstatistics.h"
6
#include "speciesresponse.h"
6
#include "speciesresponse.h"
7
#include "establishment.h"
7
#include "establishment.h"
8
8
9
class Species;
9
class Species;
10
class ResourceUnit;
10
class ResourceUnit;
11
11
12
class ResourceUnitSpecies
12
class ResourceUnitSpecies
13
{
13
{
14
public:
14
public:
15
    ResourceUnitSpecies() : mLAIfactor(0.), mSpecies(0), mRU(0) {}
15
    ResourceUnitSpecies() : mLAIfactor(0.), mSpecies(0), mRU(0) {}
16
    void setup(Species *species, ResourceUnit *ru);
16
    void setup(Species *species, ResourceUnit *ru);
17
17
-
 
18
    // access
18
    const SpeciesResponse *speciesResponse() const { return &mResponse; }
19
    const SpeciesResponse *speciesResponse() const { return &mResponse; }
19
    const Species *species() const { return mSpecies; } ///< return pointer to species
20
    const Species *species() const { return mSpecies; } ///< return pointer to species
20
    const ResourceUnit *ru() const { return mRU; } ///< return pointer to resource unit
21
    const ResourceUnit *ru() const { return mRU; } ///< return pointer to resource unit
21
    const Production3PG &prod3PG() const { return m3PG; } ///< the 3pg production model of this speies x resourceunit
22
    const Production3PG &prod3PG() const { return m3PG; } ///< the 3pg production model of this speies x resourceunit
22
    StandStatistics &statistics() { return mStatistics; } ///< statistics of this species on the resourceunit
23
    StandStatistics &statistics() { return mStatistics; } ///< statistics of this species on the resourceunit
23
    StandStatistics &statisticsDead() { return mStatisticsDead; } ///< statistics of died trees
24
    StandStatistics &statisticsDead() { return mStatisticsDead; } ///< statistics of died trees
24
    StandStatistics &statisticsMgmt() { return mStatisticsMgmt; } ///< statistics of removed trees
25
    StandStatistics &statisticsMgmt() { return mStatisticsMgmt; } ///< statistics of removed trees
25
    const StandStatistics &constStatistics() const { return mStatistics; } ///< const accessor
26
    const StandStatistics &constStatistics() const { return mStatistics; } ///< const accessor
26
    const StandStatistics &constStatisticsDead() const { return mStatisticsDead; } ///< const accessor
27
    const StandStatistics &constStatisticsDead() const { return mStatisticsDead; } ///< const accessor
27
    const StandStatistics &constStatisticsMgmt() const { return mStatisticsMgmt; } ///< const accessor
28
    const StandStatistics &constStatisticsMgmt() const { return mStatisticsMgmt; } ///< const accessor
28
29
-
 
30
   // actions
29
    void updateGWL();
31
    void updateGWL();
30
    double removedVolume() const { return mRemovedGrowth; } ///< sum of volume with was remvoved because of death/management (m3)
32
    double removedVolume() const { return mRemovedGrowth; } ///< sum of volume with was remvoved because of death/management (m3)
31
    double LAIfactor() const { return mLAIfactor; } ///< relative fraction of LAI of this species (0..1)
33
    double LAIfactor() const { return mLAIfactor; } ///< relative fraction of LAI of this species (0..1)
32
    void setLAIfactor(const double newLAIfraction) { mLAIfactor=newLAIfraction; if (mLAIfactor<0 || mLAIfactor>1.00001) qDebug() << "invalid LAIfactor"<<mLAIfactor; }
34
    void setLAIfactor(const double newLAIfraction) { mLAIfactor=newLAIfraction; if (mLAIfactor<0 || mLAIfactor>1.00001) qDebug() << "invalid LAIfactor"<<mLAIfactor; }
33
    // properties
35
    // properties
34
    double leafArea() const; ///< total leaf area of the species on the RU (m2).
36
    double leafArea() const; ///< total leaf area of the species on the RU (m2).
35
    // action
37
    // action
36
    void calculate(const bool fromEstablishment=false); ///< calculate response for species, calculate actual 3PG production
38
    void calculate(const bool fromEstablishment=false); ///< calculate response for species, calculate actual 3PG production
37
    void calclulateEstablishment(); ///< perform establishment calculations
39
    void calclulateEstablishment(); ///< perform establishment calculations
38
40
39
private:
41
private:
40
    double mLAIfactor; ///< relative amount of this species' LAI on this resource unit (0..1). Is calculated once a year.
42
    double mLAIfactor; ///< relative amount of this species' LAI on this resource unit (0..1). Is calculated once a year.
41
    double mRemovedGrowth; ///< m3 volume of trees removed/managed (to calculate GWL)
43
    double mRemovedGrowth; ///< m3 volume of trees removed/managed (to calculate GWL)
42
    StandStatistics mStatistics; ///< statistics of a species on this resource unit
44
    StandStatistics mStatistics; ///< statistics of a species on this resource unit
43
    StandStatistics mStatisticsDead; ///< statistics of died trees (this year) of a species on this resource unit
45
    StandStatistics mStatisticsDead; ///< statistics of died trees (this year) of a species on this resource unit
44
    StandStatistics mStatisticsMgmt; ///< statistics of removed trees (this year) of a species on this resource unit
46
    StandStatistics mStatisticsMgmt; ///< statistics of removed trees (this year) of a species on this resource unit
45
    Production3PG m3PG; ///< NPP prodution unit of this species
47
    Production3PG m3PG; ///< NPP prodution unit of this species
46
    SpeciesResponse mResponse; ///< calculation and storage of species specific respones on this resource unit
48
    SpeciesResponse mResponse; ///< calculation and storage of species specific respones on this resource unit
47
    Establishment mEstablishment; ///< establishment for seedlings and sapling growth
49
    Establishment mEstablishment; ///< establishment for seedlings and sapling growth
48
    Species *mSpecies; ///< speices
50
    Species *mSpecies; ///< speices
49
    ResourceUnit *mRU; ///< resource unit
51
    ResourceUnit *mRU; ///< resource unit
50
    int mLastYear;
52
    int mLastYear;
51
};
53
};
52
54
53
#endif // RESSOURCEUNITSPECIES_H
55
#endif // RESSOURCEUNITSPECIES_H
54
 
56