Subversion Repositories public iLand

Rev

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

Rev 454 Rev 462
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
#include "grid.h"
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); } ///< add a saplings on a given position
42
    void addSapling(const QPoint &position) { mSapling.addSapling(position); } ///< add a saplings on a given position
43
    void clearSaplings(const QPoint &position) { mSapling.clearSaplings(position);} ///< clear saplings on a given position (after recruitment)
43
    void clearSaplings(const QPoint &position) { mSapling.clearSaplings(position);} ///< clear saplings on a given position (after recruitment)
-
 
44
    bool hasSaplingAt(const QPoint &position) const { return mSapling.hasSapling(position); } ///< return true if a sapling of the current speices is present at 'position'
44
45
45
    // visualization/graphical output
46
    // visualization/graphical output
46
    void visualGrid(Grid<float> &grid) const;
47
    void visualGrid(Grid<float> &grid) const;
47
48
48
private:
49
private:
49
    ResourceUnitSpecies(const ResourceUnitSpecies &); // no copy
50
    ResourceUnitSpecies(const ResourceUnitSpecies &); // no copy
50
    ResourceUnitSpecies &operator=(const ResourceUnitSpecies &); // no copy
51
    ResourceUnitSpecies &operator=(const ResourceUnitSpecies &); // no copy
51
    double mLAIfactor; ///< relative amount of this species' LAI on this resource unit (0..1). Is calculated once a year.
52
    double mLAIfactor; ///< relative amount of this species' LAI on this resource unit (0..1). Is calculated once a year.
52
    double mRemovedGrowth; ///< m3 volume of trees removed/managed (to calculate GWL)
53
    double mRemovedGrowth; ///< m3 volume of trees removed/managed (to calculate GWL)
53
    StandStatistics mStatistics; ///< statistics of a species on this resource unit
54
    StandStatistics mStatistics; ///< statistics of a species on this resource unit
54
    StandStatistics mStatisticsDead; ///< statistics of died trees (this year) of a species on this resource unit
55
    StandStatistics mStatisticsDead; ///< statistics of died trees (this year) of a species on this resource unit
55
    StandStatistics mStatisticsMgmt; ///< statistics of removed trees (this year) of a species on this resource unit
56
    StandStatistics mStatisticsMgmt; ///< statistics of removed trees (this year) of a species on this resource unit
56
    Production3PG m3PG; ///< NPP prodution unit of this species
57
    Production3PG m3PG; ///< NPP prodution unit of this species
57
    SpeciesResponse mResponse; ///< calculation and storage of species specific respones on this resource unit
58
    SpeciesResponse mResponse; ///< calculation and storage of species specific respones on this resource unit
58
    Establishment mEstablishment; ///< establishment for seedlings and sapling growth
59
    Establishment mEstablishment; ///< establishment for seedlings and sapling growth
59
    Sapling mSapling; ///< saplings storage/growth
60
    Sapling mSapling; ///< saplings storage/growth
60
    Species *mSpecies; ///< speices
61
    Species *mSpecies; ///< speices
61
    ResourceUnit *mRU; ///< resource unit
62
    ResourceUnit *mRU; ///< resource unit
62
    int mLastYear;
63
    int mLastYear;
63
};
64
};
64
65
65
#endif // RESSOURCEUNITSPECIES_H
66
#endif // RESSOURCEUNITSPECIES_H
66
 
67