Subversion Repositories public iLand

Rev

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

Rev 451 Rev 453
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
#include "sapling.h"
8
#include "sapling.h"
9
-
 
-
 
9
#include "grid.h"
10
class Species;
10
class Species;
11
class ResourceUnit;
11
class ResourceUnit;
12
12
13
class ResourceUnitSpecies
13
class ResourceUnitSpecies
14
{
14
{
15
public:
15
public:
16
    ResourceUnitSpecies() : mLAIfactor(0.), mSpecies(0), mRU(0) {}
16
    ResourceUnitSpecies() : mLAIfactor(0.), mSpecies(0), mRU(0) {}
17
    void setup(Species *species, ResourceUnit *ru);
17
    void setup(Species *species, ResourceUnit *ru);
18
18
19
    // access
19
    // access
20
    const SpeciesResponse *speciesResponse() const { return &mResponse; }
20
    const SpeciesResponse *speciesResponse() const { return &mResponse; }
21
    const Species *species() const { return mSpecies; } ///< return pointer to species
21
    const Species *species() const { return mSpecies; } ///< return pointer to species
22
    const ResourceUnit *ru() const { return mRU; } ///< return pointer to resource unit
22
    const ResourceUnit *ru() const { return mRU; } ///< return pointer to resource unit
23
    const Production3PG &prod3PG() const { return m3PG; } ///< the 3pg production model of this speies x resourceunit
23
    const Production3PG &prod3PG() const { return m3PG; } ///< the 3pg production model of this speies x resourceunit
24
    StandStatistics &statistics() { return mStatistics; } ///< statistics of this species on the resourceunit
24
    StandStatistics &statistics() { return mStatistics; } ///< statistics of this species on the resourceunit
25
    StandStatistics &statisticsDead() { return mStatisticsDead; } ///< statistics of died trees
25
    StandStatistics &statisticsDead() { return mStatisticsDead; } ///< statistics of died trees
26
    StandStatistics &statisticsMgmt() { return mStatisticsMgmt; } ///< statistics of removed trees
26
    StandStatistics &statisticsMgmt() { return mStatisticsMgmt; } ///< statistics of removed trees
27
    const StandStatistics &constStatistics() const { return mStatistics; } ///< const accessor
27
    const StandStatistics &constStatistics() const { return mStatistics; } ///< const accessor
28
    const StandStatistics &constStatisticsDead() const { return mStatisticsDead; } ///< const accessor
28
    const StandStatistics &constStatisticsDead() const { return mStatisticsDead; } ///< const accessor
29
    const StandStatistics &constStatisticsMgmt() const { return mStatisticsMgmt; } ///< const accessor
29
    const StandStatistics &constStatisticsMgmt() const { return mStatisticsMgmt; } ///< const accessor
30
30
31
   // actions
31
   // actions
32
    void updateGWL();
32
    void updateGWL();
33
    double removedVolume() const { return mRemovedGrowth; } ///< sum of volume with was remvoved because of death/management (m3)
33
    double removedVolume() const { return mRemovedGrowth; } ///< sum of volume with was remvoved because of death/management (m3)
34
    double LAIfactor() const { return mLAIfactor; } ///< relative fraction of LAI of this species (0..1)
34
    double LAIfactor() const { return mLAIfactor; } ///< relative fraction of LAI of this species (0..1)
35
    void setLAIfactor(const double newLAIfraction) { mLAIfactor=newLAIfraction; if (mLAIfactor<0 || mLAIfactor>1.00001) qDebug() << "invalid LAIfactor"<<mLAIfactor; }
35
    void setLAIfactor(const double newLAIfraction) { mLAIfactor=newLAIfraction; if (mLAIfactor<0 || mLAIfactor>1.00001) qDebug() << "invalid LAIfactor"<<mLAIfactor; }
36
    // properties
36
    // properties
37
    double leafArea() const; ///< total leaf area of the species on the RU (m2).
37
    double leafArea() const; ///< total leaf area of the species on the RU (m2).
38
    // action
38
    // action
39
    void calculate(const bool fromEstablishment=false); ///< calculate response for species, calculate actual 3PG production
39
    void calculate(const bool fromEstablishment=false); ///< calculate response for species, calculate actual 3PG production
40
    void calclulateEstablishment(); ///< perform establishment calculations
40
    void calclulateEstablishment(); ///< perform establishment calculations
41
    void calclulateSaplingGrowth(); ///< growth of saplings
41
    void calclulateSaplingGrowth(); ///< growth of saplings
42
    void addSapling(const QPoint position) { mSapling.addSapling(position); }
42
    void addSapling(const QPoint position) { mSapling.addSapling(position); }
-
 
43
    // visualization/graphical output
-
 
44
    void visualGrid(Grid<float> &grid) const;
43
45
44
private:
46
private:
45
    double mLAIfactor; ///< relative amount of this species' LAI on this resource unit (0..1). Is calculated once a year.
47
    double mLAIfactor; ///< relative amount of this species' LAI on this resource unit (0..1). Is calculated once a year.
46
    double mRemovedGrowth; ///< m3 volume of trees removed/managed (to calculate GWL)
48
    double mRemovedGrowth; ///< m3 volume of trees removed/managed (to calculate GWL)
47
    StandStatistics mStatistics; ///< statistics of a species on this resource unit
49
    StandStatistics mStatistics; ///< statistics of a species on this resource unit
48
    StandStatistics mStatisticsDead; ///< statistics of died trees (this year) of a species on this resource unit
50
    StandStatistics mStatisticsDead; ///< statistics of died trees (this year) of a species on this resource unit
49
    StandStatistics mStatisticsMgmt; ///< statistics of removed trees (this year) of a species on this resource unit
51
    StandStatistics mStatisticsMgmt; ///< statistics of removed trees (this year) of a species on this resource unit
50
    Production3PG m3PG; ///< NPP prodution unit of this species
52
    Production3PG m3PG; ///< NPP prodution unit of this species
51
    SpeciesResponse mResponse; ///< calculation and storage of species specific respones on this resource unit
53
    SpeciesResponse mResponse; ///< calculation and storage of species specific respones on this resource unit
52
    Establishment mEstablishment; ///< establishment for seedlings and sapling growth
54
    Establishment mEstablishment; ///< establishment for seedlings and sapling growth
53
    Sapling mSapling; ///< saplings storage/growth
55
    Sapling mSapling; ///< saplings storage/growth
54
    Species *mSpecies; ///< speices
56
    Species *mSpecies; ///< speices
55
    ResourceUnit *mRU; ///< resource unit
57
    ResourceUnit *mRU; ///< resource unit
56
    int mLastYear;
58
    int mLastYear;
57
};
59
};
58
60
59
#endif // RESSOURCEUNITSPECIES_H
61
#endif // RESSOURCEUNITSPECIES_H
60
 
62