59 bool trace()
const {
return property(QStringLiteral(
"trace")).toBool(); }
60 const QString &
context()
const {
return mContextStr; }
63 void setArea(
const double new_area_ha) { mArea = new_area_ha; }
65 void reload(
bool force=
false);
67 int id()
const {
return mId; }
78 double U()
const {
return mU; }
84 void setU(
const double rotation_length) { mU = rotation_length; }
90 double area()
const {
return mArea; }
96 double age()
const {
return mAge; }
98 double volume()
const {
return mVolume; }
100 double stems()
const {
return mStems; }
102 double dbh()
const {
return mDbh; }
110 double totalHarvest()
const {
return mFinalHarvested + mThinningHarvest + mSalvaged; }
126 double basalArea(
const QString &species_id)
const;
129 int nspecies()
const {
return mSpeciesData.count(); }
154 void sleep(
int years_to_sleep);
183 void setProperty(
const QString &name, QJSValue value);
185 QJSValue
property(
const QString &name)
const;
198 double mTotalBasalArea;
205 double mScheduledHarvest;
206 double mFinalHarvested;
207 double mThinningHarvest;
211 double mRemovedVolumeDecade;
212 double mRemovedVolumeTotal;
214 double mLastMAIVolume;
219 int mRotationStartYear;
224 int mLastExecutedIndex;
225 int mLastRotationAge;
228 int mSpeciesCompositionIndex;
229 int mThinningIntensityClass;
231 void newRotatation();
234 QVector<SSpeciesStand> mSpeciesData;
236 QVector<ActivityFlags> mStandFlags;
239 static QHash<const FMStand*, QHash<QString, QJSValue> > mStandPropertyStorage;
Activity meta data (enabled, active, ...) that need to be stored per stand.
Definition: activity.h:110
Activity is the base class for management activities.
Definition: activity.h:162
Phase
Definition: activity.h:171
The FMSTP class encapsulates a stand treatment program, which is defined in Javascript.
Definition: fmstp.h:39
FMStand encapsulates a forest stand for the forest management engine.
Definition: fmstand.h:49
Activity * currentActivity() const
get a pointer to the current activity; returns 0 if no activity is set.
Definition: fmstand.h:173
void setTargetSpeciesIndex(const int index)
Definition: fmstand.h:86
int lastExecution() const
Definition: fmstand.h:73
void resetDisturbanceSalvage()
Definition: fmstand.h:150
bool trace() const
returns true if tracing is enabled for the stand
Definition: fmstand.h:59
int lastExecutionAge() const
Definition: fmstand.h:178
bool readyForFinalHarvest()
Definition: fmstand.h:123
ActivityFlags & flags(const int index)
Definition: fmstand.h:169
int id() const
Definition: fmstand.h:67
double volume() const
total standing volume (m3/ha) in the stand
Definition: fmstand.h:98
bool afterExecution(bool cancel=false)
Definition: fmstand.cpp:388
void setInitialId(int origin_id)
Definition: fmstand.h:75
void setThinningIntensity(const int th_class)
Definition: fmstand.h:85
double area() const
total area of the stand (ha)
Definition: fmstand.h:90
Activity::Phase phase() const
Definition: fmstand.h:69
int targetSpeciesIndex() const
species composition key
Definition: fmstand.h:82
void addScheduledHarvest(const double add_volume)
add a (simulated) harvest to the amount of planned harvest (used by the scheduling)
Definition: fmstand.h:142
static void clearAllProperties()
Definition: fmstand.h:181
double totalThinningHarvest() const
total realized thinning/tending harvests (m3 on the full stand area)
Definition: fmstand.h:112
double disturbedTimber() const
total disturbed timber volume, includes also disturbed trees not harvested, m3
Definition: fmstand.h:114
FMSTP * stp() const
Definition: fmstand.h:71
SSpeciesStand & speciesData(const int index)
retrieve species-specific meta data by index (0: largest basal area share, up to nspecies()-1)
Definition: fmstand.h:131
void checkArea()
Definition: fmstand.cpp:182
int initialStandId() const
Definition: fmstand.h:74
double scheduledHarvest() const
scheduled harvest (planned harvest by activities, m3)
Definition: fmstand.h:108
void notifyTreeRemoval(Tree *tree, int reason)
is called whenever a tree is removed (death, management, disturbance)
Definition: fmstand.cpp:457
void setArea(const double new_area_ha)
Definition: fmstand.h:63
int standType() const
Definition: fmstand.h:70
int thinningIntensity() const
thinning intensity (class); 1: low, 2: medium, 3: high
Definition: fmstand.h:80
void initialize()
Definition: fmstand.cpp:90
bool executeActivity(Activity *act)
execute activity given by "act".
Definition: fmstand.cpp:369
double stems() const
number of trees of the stand (stems/ha) (>4m)
Definition: fmstand.h:100
double meanAnnualIncrement() const
mean annual increment (MAI), m3 timber/ha for the last decade
Definition: fmstand.h:119
bool execute()
main function
Definition: fmstand.cpp:273
QJSValue property(const QString &name) const
retrieve the value of the property 'name'. Returns an empty QJSValue if the property is not defined.
Definition: fmstand.cpp:573
double age() const
(average) age of the stand (weighted with basal area)
Definition: fmstand.h:96
int setToLatestForcedActivity()
set active activity to the latest activity with forced=true (if a stand is outside the timeframe of a...
Definition: fmstand.cpp:547
void setProperty(const QString &name, QJSValue value)
set a property value for the current stand with the name 'name'
Definition: fmstand.cpp:567
double relBasalArea(const QString &species_id) const
Definition: fmstand.cpp:533
const QString & context() const
Definition: fmstand.h:60
double absoluteAge() const
absolute age: years since the rotation has started (years)
Definition: fmstand.cpp:267
double height() const
mean tree height (basal area weighted, of trees>4m), in m
Definition: fmstand.h:104
double meanAnnualIncrementTotal() const
mean annual increment (MAI), m3 timber/ha for the full rotation period
Definition: fmstand.h:121
Activity * lastExecutedActivity() const
get a pointer to the last executed activity; returns 0 if no activity has been executed before.
Definition: fmstand.h:176
double salvagedTimber() const
total amount of timber removed by salvage operation
Definition: fmstand.h:116
int sleepYears() const
Definition: fmstand.h:155
double basalArea() const
total basal area (m2/ha)
Definition: fmstand.h:94
double dbh() const
mean dbh (basal area weighted, of trees>4m) in cm
Definition: fmstand.h:102
void reload(bool force=false)
Definition: fmstand.cpp:192
double totalHarvest() const
total realized harvest (m3 on the full stand area)
Definition: fmstand.h:110
void resetHarvestCounter()
resets the harvest counters
Definition: fmstand.h:149
double calculateMAI()
calculate mean annual increment (m3/ha) and return total MAI.
Definition: fmstand.cpp:511
FMStand(FMUnit *unit, const int id)
c'tor: link stand to a forest management unit
Definition: fmstand.cpp:51
int lastUpdate() const
Definition: fmstand.h:72
void setAbsoluteAge(const double age)
set the absolute age of the stand
Definition: fmstand.cpp:541
void sleep(int years_to_sleep)
sleep() pauses the evaluation/execution of management activities for 'years_to_sleep'.
Definition: fmstand.cpp:505
bool notifyBarkBeetleAttack(double generations, int infested_px_per_ha)
is called when bark beetles are likely to attack: return ABE changed forest structure
Definition: fmstand.cpp:495
void setSTP(FMSTP *stp)
set the stand to be managed by a given 'stp'
Definition: fmstand.h:54
int nspecies() const
Definition: fmstand.h:129
double U() const
rotation period (years)
Definition: fmstand.h:78
void reset(FMSTP *stp)
sets the STP but nothing else (after disturbance related clearance)
Definition: fmstand.cpp:175
void setU(const double rotation_length)
Definition: fmstand.h:84
const FMUnit * unit() const
Definition: fmstand.h:68
QStringList info()
Definition: fmstand.cpp:584
ActivityFlags & currentFlags()
flags of currently active Activity
Definition: fmstand.h:171
double topHeight() const
top height (mean height of the 100 thickest trees/ha), in m
Definition: fmstand.h:106
The FMUnit represents a management unit, i.e.
Definition: fmunit.h:32
FOMEWrapper provides the context for the Forest Management Engine This wrapper blends activties,...
Definition: fomewrapper.h:33
StandObj is the bridge to stand variables from the Javascript world.
Definition: fomescript.h:161
The behavior and general properties of tree species.
Definition: species.h:75
A tree is the basic simulation entity of iLand and represents a single tree.
Definition: tree.h:44
SSpeciesStand()
Definition: fmstand.h:38
double relBasalArea
fraction [0..1] fraction of species based on basal area.
Definition: fmstand.h:41
double basalArea
basal area m2
Definition: fmstand.h:40
const Species * species
the ID of the species (ie a pointer)
Definition: fmstand.h:39