22#include <QtCore/QVector>
23#include <QtCore/QPoint>
36 short unsigned int age;
56 void clear() { mSaplingTrees.clear(); mSapBitset.reset(); }
61 const QVector<SaplingTreeOld> &
saplings()
const {
return mSaplingTrees; }
66 int addSapling(
const QPoint &pos_lif,
const float height=0.05f,
const int age=1);
71 void clearSaplings(
const QRectF &rectangle,
const bool remove_biomass);
73 double heightAt(
const QPoint &position)
const;
79 double livingStemNumber(
double &rAvgDbh,
double &rAvgHeight,
double &rAvgAge)
const;
94 void setBit(
const QPoint &pos_index,
bool value);
96 QVector<SaplingTreeOld> mSaplingTrees;
97 std::bitset<cPxPerRU*cPxPerRU> mSapBitset;
105 double mAvgDeltaHPot;
106 double mAvgHRealized;
107 static double mRecruitmentVariation;
108 static double mBrowsingPressure;
CNPair stores a duple of carbon and nitrogen (kg/ha) use addBiomass(biomass, cnratio) to add biomass;...
Definition: snag.h:31
Model * model() const
Definition: globalsettings.h:55
static GlobalSettings * instance()
Definition: globalsettings.h:51
QPoint indexOf(const int index) const
get index (x/y) of the (linear) index 'index' (0..count-1)
Definition: grid.h:127
FloatGrid * grid()
this is the global 'LIF'-grid (light patterns) (currently 2x2m)
Definition: model.h:124
The class contains data available at ResourceUnit x Species scale.
Definition: resourceunitspecies.h:34
saplings from 5cm to 4m
Definition: sapling.h:48
int addSapling(const QPoint &pos_lif, const float height=0.05f, const int age=1)
add a new sapling at 'pos_lif' (i.e.
Definition: sapling.cpp:180
int newSaplings() const
Definition: sapling.h:75
double representedStemNumber(float height) const
return the number of trees represented by one sapling of the current species and given 'height'
Definition: sapling.cpp:94
double heightAt(const QPoint &position) const
return the height at given position or 0 if position is not occupied
Definition: sapling.cpp:157
double livingStemNumber(double &rAvgDbh, double &rAvgHeight, double &rAvgAge) const
returns the represented (Reineke's Law) number of trees (N/ha) and the mean dbh/height (cm/m)
Definition: sapling.cpp:66
static void setRecruitmentVariation(const double variation)
Definition: sapling.h:57
int recruitedSaplings() const
Definition: sapling.h:78
double averageDeltaHPot() const
Definition: sapling.h:82
bool hasSapling(const QPoint &position) const
return true if sapling is present at position
Definition: sapling.cpp:137
void setup(ResourceUnitSpecies *masterRUS)
Definition: sapling.h:52
static void updateBrowsingPressure()
Definition: sapling.cpp:57
double averageDeltaHRealized() const
Definition: sapling.h:83
const std::bitset< cPxPerRU *cPxPerRU > & presentPositions() const
Definition: sapling.h:91
void fillMaxHeightGrid(Grid< float > &grid) const
fill a grid with the maximum height of saplings per pixel (2x2m).
Definition: sapling.cpp:457
double averageAge() const
Definition: sapling.h:81
void cleanupStorage()
maintenance function to clear dead/recruited saplings from storage
Definition: sapling.cpp:103
Sapling()
Definition: sapling.cpp:39
void clearSaplings(const QPoint &position)
clear saplings on a given position (after recruitment)
Definition: sapling.cpp:195
double averageHeight() const
Definition: sapling.h:80
void calculateGrowth()
perform growth + mortality + recruitment of all saplings of this RU and species
Definition: sapling.cpp:352
void clear()
Definition: sapling.h:56
void clearSapling(SaplingTreeOld &tree, const bool remove)
clear (either remove or kill) a specific sapling
Definition: sapling.cpp:225
int livingSaplings() const
get the number
Definition: sapling.h:77
const CNPair & carbonGain() const
state of the living
Definition: sapling.h:88
const QVector< SaplingTreeOld > & saplings() const
Definition: sapling.h:61
int diedSaplings() const
Definition: sapling.h:76
void clearStatistics()
Definition: sapling.cpp:47
const CNPair & carbonLiving() const
state of the living
Definition: sapling.h:87
void newYear()
Definition: sapling.h:55
SaplingTreeOld holds information of a sapling (which represents N trees). Emphasis is on efficient st...
Definition: sapling.h:29
float * pixel
Definition: sapling.h:33
bool isValid() const
Definition: sapling.h:32
SaplingTreeOld()
Definition: sapling.h:31
float height
Definition: sapling.h:39
QPoint coords() const
Definition: sapling.h:34
short unsigned int stress_years
Definition: sapling.h:37
short unsigned int age
Definition: sapling.h:36
way to save/load the current state of the model to a database.
Definition: snapshot.h:35
The behavior and general properties of tree species.
Definition: species.h:75