51 int id()
const {
return mId; }
52 int age()
const {
return mAge; }
62 float dbh()
const {
return mDbh; }
63 float height()
const {
return mHeight; }
68 bool isDead()
const {
return flag(Tree::TreeDead); }
94 void removeDisturbance(
const double stem_to_soil_fraction,
const double stem_to_snag_fraction,
95 const double branch_to_soil_fraction,
const double branch_to_snag_fraction,
96 const double foliage_to_soil_fraction);
98 void enableDebugging(
const bool enable=
true) {setFlag(Tree::TreeDebugging, enable); }
101 void removeBiomassOfTree(
const double removeFoliageFraction,
const double removeBranchFraction,
const double removeStemFraction);
103 void removeRootBiomass(
const double removeFineRootFraction,
const double removeCoarseRootFraction);
108 void setPosition(
const QPointF pos) { Q_ASSERT(mGrid!=
nullptr); mPositionIndex = mGrid->
indexAt(pos); }
109 void setPosition(
const QPoint posIndex) { mPositionIndex = posIndex; }
114 void setAge(
const int age,
const float treeheight);
119 void markForCut(
bool do_mark) { setFlag(Tree::MarkForCut, do_mark);}
121 void markCropTree(
bool do_mark) { setFlag(Tree::MarkCropTree, do_mark);}
137 bool isCutdown()
const {
return flag(Tree::TreeDeadKillAndDrop);}
159#ifdef ALT_TREE_MORTALITY
160 static void mortalityParams(
double dbh_inc_threshold,
int stress_years,
double stress_mort_prob);
164 void dumpList(QList<QVariant> &rTargetList);
170 double relative_height_growth();
174#ifdef ALT_TREE_MORTALITY
184 QPoint mPositionIndex;
192 float mCoarseRootMass;
196 float mLightResponse;
209 enum Flags { TreeDead=1, TreeDebugging=2,
210 TreeDeadBarkBeetle=16, TreeDeadWind=32, TreeDeadFire=64, TreeDeadKillAndDrop=128, TreeHarvested=256,
214 MarkCropCompetitor=4096,
215 TreeAffectedBite=8192
218 void setFlag(
const Tree::Flags flag,
const bool value) {
if (value) mFlags |= flag;
else mFlags &= (flag ^ 0xffffff );}
220 void setFlag(
const int flag,
const bool value) {
if (value) mFlags |= flag;
else mFlags &= (flag ^ 0xffffff );}
222 bool flag(
const Tree::Flags flag)
const {
return mFlags & flag; }
224 int flags()
const {
return mFlags; }
227 bool isDebugging() {
return flag(Tree::TreeDebugging); }
233 static void setTreeRemovalOutput(
TreeRemovedOut *rout) { mRemovalOutput=rout; }
235 static void setLandscapeRemovalOutput(
LandscapeRemovedOut *rout) { mLSRemovalOutput=rout; }
239 static int m_statPrint;
240 static int m_statAboveZ;
241 static int m_statCreated;
QPointF cellCenterPoint(const QPoint &pos) const
get the (metric) centerpoint of cell with index pos
Definition: grid.h:141
QPoint indexAt(const QPointF &pos) const
get index of value at position pos (metric)
Definition: grid.h:125
LandscapeRemovedOut is aggregated output for removed trees on the full landscape.
Definition: landscapeout.h:43
ResourceUnit is the spatial unit that encapsulates a forest stand and links to several environmental ...
Definition: resourceunit.h:49
The Saplings class the container for the establishment and sapling growth in iLand.
Definition: saplings.h:192
Definition: scripttree.h:10
way to save/load the current state of the model to a database.
Definition: snapshot.h:35
Definition: snapshot.cpp:42
The behavior and general properties of tree species.
Definition: species.h:75
Stamp is the basic class for the LIP field of a individual tree.
Definition: stamp.h:32
Collects information on stand level for each tree species.
Definition: standstatistics.h:28
A tree is the basic simulation entity of iLand and represents a single tree.
Definition: tree.h:44
const QPoint positionIndex() const
the x/y indicies (2m grid) of the tree
Definition: tree.h:57
void readLIF_torus()
calculate LRI from a closed 1ha area
Definition: tree.cpp:529
const QPointF position() const
metric coordinates of the tree
Definition: tree.h:54
void applyLIP()
apply LightInfluencePattern onto the global grid
Definition: tree.cpp:176
float height() const
tree height in m
Definition: tree.h:63
void markForHarvest(bool do_mark)
Definition: tree.h:117
static void resetStatistics()
Definition: tree.cpp:603
double volume() const
volume (m3) of stem volume based on geometry and density calculated on the fly.
Definition: tree.cpp:1164
void removeRootBiomass(const double removeFineRootFraction, const double removeCoarseRootFraction)
remove root biomass of trees (e.g. due to funghi)
Definition: tree.cpp:1069
double barkThickness() const
mass (kg) of the reserve pool
Definition: tree.cpp:112
void removeBiomassOfTree(const double removeFoliageFraction, const double removeBranchFraction, const double removeStemFraction)
removes fractions (0..1) for foliage, branches, stem, and roots from a tree, e.g.
Definition: tree.cpp:1055
bool isAffectedBite() const
Definition: tree.h:136
void setSpecies(Species *ts)
Definition: tree.h:112
void enableDebugging(const bool enable=true)
Definition: tree.h:98
void readLIF()
calculate the lightResourceIndex with multiplicative approach
Definition: tree.cpp:464
void setDeathReasonFire()
Definition: tree.h:128
float biomassBranch() const
mass (kg) of branches
Definition: tree.h:72
void applyLIP_torus()
apply LightInfluencePattern on a closed 1ha area
Definition: tree.cpp:231
void setHeight(const float height)
Definition: tree.cpp:1083
bool isMarkedAsCropTree() const
Definition: tree.h:122
float leafArea() const
leaf area (m2) of the tree
Definition: tree.h:65
int id() const
numerical unique ID of the tree
Definition: tree.h:51
bool isDeadFire() const
Definition: tree.h:135
float crownRadius() const
fetch crown radius (m) from the attached stamp
Definition: tree.cpp:97
void setDeathReasonWind()
Definition: tree.h:126
void setAge(const int age, const float treeheight)
Definition: tree.cpp:159
void setIsHarvested()
Definition: tree.h:131
static int statPrints()
Definition: tree.h:157
void setPosition(const QPointF pos)
Definition: tree.h:108
void markForCut(bool do_mark)
Definition: tree.h:119
static void setGrid(FloatGrid *gridToStamp, Grid< HeightGridValue > *dominanceGrid)
Definition: tree.cpp:106
void markCropTree(bool do_mark)
Definition: tree.h:121
void setDeathReasonBarkBeetle()
Definition: tree.h:127
const Species * species() const
pointer to the tree species of the tree.
Definition: tree.h:58
void setAffectedBite()
Definition: tree.h:130
void setPosition(const QPoint posIndex)
Definition: tree.h:109
bool isDeadWind() const
Definition: tree.h:133
void setDbh(const float dbh)
Definition: tree.h:110
void heightGrid_torus()
calculate the height grid
Definition: tree.cpp:365
float biomassCoarseRoot() const
mass (kg) of coarse roots
Definition: tree.h:74
void dumpList(QList< QVariant > &rTargetList)
Definition: tree.cpp:127
bool isDead() const
returns true if the tree is already dead.
Definition: tree.h:68
void heightGrid()
calculate the height grid
Definition: tree.cpp:284
bool isDeadBarkBeetle() const
Definition: tree.h:134
float biomassFoliage() const
mass (kg) of foliage
Definition: tree.h:71
float biomassFineRoot() const
mass (kg) of fine roots
Definition: tree.h:73
QString dump()
dumps some core variables of a tree to a string.
Definition: tree.cpp:118
bool isMarkedAsCropCompetitor() const
Definition: tree.h:124
float biomassStem() const
mass (kg) of stem, conceputally stem biomass + reserve pool
Definition: tree.h:75
void die(TreeGrowthData *d=nullptr)
the tree dies (is killed)
Definition: tree.cpp:997
void calcLightResponse()
calculate light response
Definition: tree.cpp:621
float biomassReserve() const
Definition: tree.h:76
int age() const
the tree age (years)
Definition: tree.h:52
void setId(const int id)
set a spcific ID (if provided in stand init file).
Definition: tree.h:107
bool isHarvested() const
Definition: tree.h:138
void setRU(ResourceUnit *ru)
Definition: tree.h:113
void setNewId()
force a new id for this object (after copying trees)
Definition: tree.h:106
bool isCutdown() const
Definition: tree.h:137
float stressIndex() const
the scalar stress rating (0..1)
Definition: tree.h:78
static int statCreated()
Definition: tree.h:158
void grow()
main growth function to update the tree state.
Definition: tree.cpp:643
Tree()
Definition: tree.cpp:79
const ResourceUnit * ru() const
pointer to the ressource unit the tree belongs to.
Definition: tree.h:59
double basalArea() const
basal area of the tree at breast height in m2
Definition: tree.cpp:1173
bool isMarkedForHarvest() const
Definition: tree.h:118
void removeDisturbance(const double stem_to_soil_fraction, const double stem_to_snag_fraction, const double branch_to_soil_fraction, const double branch_to_snag_fraction, const double foliage_to_soil_fraction)
remove the tree due to an special event (disturbance) the part of the biomass that goes not to soil/s...
Definition: tree.cpp:1030
void setup()
calculates initial values for biomass pools etc. after dimensions are set.
Definition: tree.cpp:133
void setDeathCutdown()
Definition: tree.h:129
TreeRemovalType
Definition: tree.h:81
@ TreeKilled
Definition: tree.h:81
@ TreeDeath
Definition: tree.h:81
@ TreeHarvest
Definition: tree.h:81
@ TreeSalavaged
Definition: tree.h:81
@ TreeCutDown
Definition: tree.h:81
@ TreeDisturbance
Definition: tree.h:81
void remove(double removeFoliage=0., double removeBranch=0., double removeStem=0.)
remove the tree (management).
Definition: tree.cpp:1009
float dbh() const
dimater at breast height in cm
Definition: tree.h:62
float lightResourceIndex() const
LRI of the tree (updated during readStamp())
Definition: tree.h:64
const Stamp * stamp() const
TODO: only for debugging purposes.
Definition: tree.h:165
bool isMarkedForCut() const
Definition: tree.h:120
void markCropCompetitor(bool do_mark)
Definition: tree.h:123
Definition: expressionwrapper.h:42
double removeBranch()
Definition: fmtreelist.cpp:50
double removeFoliage()
Definition: fmtreelist.cpp:48
double removeStem()
Definition: fmtreelist.cpp:49
internal data structure which is passed between function and to statistics
Definition: tree.h:257
double stress_index
stress index used for mortality calculation
Definition: tree.h:261
double NPP
total NPP (kg)
Definition: tree.h:258
double NPP_above
NPP aboveground (kg) (NPP - fraction roots), no consideration of tree senescence.
Definition: tree.h:259
TreeGrowthData()
Definition: tree.h:262
double NPP_stem
NPP used for growth of stem (dbh,h)
Definition: tree.h:260