Subversion Repositories public iLand

Rev

Rev 462 | Rev 469 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 462 Rev 468
Line 5... Line 5...
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
10
class Species;
11
class Species;
11
class ResourceUnit;
12
class ResourceUnit;
-
 
13
class Snag;
12
14
13
class ResourceUnitSpecies
15
class ResourceUnitSpecies
14
{
16
{
15
public:
17
public:
16
    ResourceUnitSpecies() : mLAIfactor(0.), mSpecies(0), mRU(0) {}
18
    ResourceUnitSpecies() : mLAIfactor(0.), mSpecies(0), mRU(0) {}
-
 
19
    ~ResourceUnitSpecies();
17
    void setup(Species *species, ResourceUnit *ru);
20
    void setup(Species *species, ResourceUnit *ru);
18
21
19
    // access
22
    // access
20
    const SpeciesResponse *speciesResponse() const { return &mResponse; }
23
    const SpeciesResponse *speciesResponse() const { return &mResponse; }
21
    const Species *species() const { return mSpecies; } ///< return pointer to species
24
    const Species *species() const { return mSpecies; } ///< return pointer to species
Line 35... Line 38...
35
    void setLAIfactor(const double newLAIfraction) { mLAIfactor=newLAIfraction; if (mLAIfactor<0 || mLAIfactor>1.00001) qDebug() << "invalid LAIfactor"<<mLAIfactor; }
38
    void setLAIfactor(const double newLAIfraction) { mLAIfactor=newLAIfraction; if (mLAIfactor<0 || mLAIfactor>1.00001) qDebug() << "invalid LAIfactor"<<mLAIfactor; }
36
    // properties
39
    // properties
37
    double leafArea() const; ///< total leaf area of the species on the RU (m2).
40
    double leafArea() const; ///< total leaf area of the species on the RU (m2).
38
    // action
41
    // action
39
    void calculate(const bool fromEstablishment=false); ///< calculate response for species, calculate actual 3PG production
42
    void calculate(const bool fromEstablishment=false); ///< calculate response for species, calculate actual 3PG production
-
 
43
    // establishment, sapling growth
40
    void calclulateEstablishment(); ///< perform establishment calculations
44
    void calclulateEstablishment(); ///< perform establishment calculations
41
    void calclulateSaplingGrowth(); ///< growth of saplings
45
    void calclulateSaplingGrowth(); ///< growth of saplings
42
    void addSapling(const QPoint &position) { mSapling.addSapling(position); } ///< add a saplings on a given position
46
    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)
47
    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'
48
    bool hasSaplingAt(const QPoint &position) const { return mSapling.hasSapling(position); } ///< return true if a sapling of the current speices is present at 'position'
45
-
 
-
 
49
    // snag dynamics, soil carbon and nitrogen cycle
-
 
50
    Snag *snag() const { return mSnag; } ///< access the snag object
46
    // visualization/graphical output
51
    // visualization/graphical output
47
    void visualGrid(Grid<float> &grid) const;
52
    void visualGrid(Grid<float> &grid) const;
48
53
49
private:
54
private:
50
    ResourceUnitSpecies(const ResourceUnitSpecies &); // no copy
55
    ResourceUnitSpecies(const ResourceUnitSpecies &); // no copy
Line 56... Line 61...
56
    StandStatistics mStatisticsMgmt; ///< statistics of removed trees (this year) of a species on this resource unit
61
    StandStatistics mStatisticsMgmt; ///< statistics of removed trees (this year) of a species on this resource unit
57
    Production3PG m3PG; ///< NPP prodution unit of this species
62
    Production3PG m3PG; ///< NPP prodution unit of this species
58
    SpeciesResponse mResponse; ///< calculation and storage of species specific respones on this resource unit
63
    SpeciesResponse mResponse; ///< calculation and storage of species specific respones on this resource unit
59
    Establishment mEstablishment; ///< establishment for seedlings and sapling growth
64
    Establishment mEstablishment; ///< establishment for seedlings and sapling growth
60
    Sapling mSapling; ///< saplings storage/growth
65
    Sapling mSapling; ///< saplings storage/growth
-
 
66
    Snag *mSnag; ///< ptr to snag storage / dynamics
61
    Species *mSpecies; ///< speices
67
    Species *mSpecies; ///< link to speices
62
    ResourceUnit *mRU; ///< resource unit
68
    ResourceUnit *mRU; ///< link to resource unit
63
    int mLastYear;
69
    int mLastYear;
64
};
70
};
65
71
66
#endif // RESSOURCEUNITSPECIES_H
72
#endif // RESSOURCEUNITSPECIES_H