25#include <QtCore/QVariantList>
57 int count()
const {
return mTrees.count();}
61 QJSValue
tree(
int index);
66 double mean(QString expression, QString
filter=QString()) {
return aggregate_function( expression,
filter,
"mean"); }
68 double sum(QString expression, QString
filter=QString()) {
return aggregate_function( expression,
filter,
"sum"); }
76 int killPct(
int pctfrom,
int pctto,
int number);
85 int disturbanceKill(
double stem_to_soil_fraction,
double stem_to_snag_fraction,
double branch_to_soil_fraction,
double branch_to_snag_fraction, QString agent);
94 int managePct(
int pctfrom,
int pctto,
int number);
119 void sort(QString statement);
124 QString executeScript(QString cmd=
"");
125 int remove_percentiles(
int pctfrom,
int pctto,
int number,
bool management);
126 int remove_trees(QString expression,
double fraction,
bool management);
127 double aggregate_function(QString expression, QString
filter, QString type);
128 void throwError(
const QString &errormessage);
131 double mRemoveFoliage, mRemoveBranch, mRemoveStem;
133 QList<QPair<Tree*, double> > mTrees;
management routines.
Definition: management.h:32
void sort(QString statement)
sort trees in the list according to a criterion
Definition: management.cpp:591
void setRemoveBranch(const double fraction)
Definition: management.h:54
double removeBranch() const
removal fraction branch biomass: 0: 0% will be removed, 1: 100% will be removed from the forest by ma...
Definition: management.h:49
void loadFromTreeList(QList< Tree * >tree_list)
load a previously present tree list
Definition: management.cpp:450
void loadFromMap(const MapGrid *map_grid, int key)
load all trees that are on the area denoted by 'key' of the given grid
Definition: management.cpp:571
int disturbanceKill(double stem_to_soil_fraction, double stem_to_snag_fraction, double branch_to_soil_fraction, double branch_to_snag_fraction, QString agent)
kill all trees (disturbance related)
Definition: management.cpp:107
void randomize()
random shuffle of all trees in the list
Definition: management.cpp:616
double removeFoliage() const
removal fraction foliage: 0: 0% will be removed, 1: 100% will be removed from the forest by managemen...
Definition: management.h:47
void setRemoveFoliage(const double fraction)
Definition: management.h:53
int managePct(int pctfrom, int pctto, int number)
kill "number" of stems in the percentile interval "from" - "to".
Definition: management.cpp:302
void slashSnags(MapGridWrapper *wrap, int key, double slash_fraction)
slash snags (SWD and otherWood-Pools) of polygon 'key' on the map 'wrap'.
Definition: management.cpp:550
int load(QString filter)
load all trees passing the filter in a list, return number of trees
Definition: management.cpp:425
~Management()
Definition: management.cpp:73
void loadScript(const QString &fileName)
Definition: management.cpp:334
double sum(QString expression, QString filter=QString())
calculate the sum for all trees in the internal list for the 'expression' (filtered by the filter cri...
Definition: management.h:68
void setRemoveStem(const double fraction)
Definition: management.h:55
void removeSoilCarbon(MapGridWrapper *wrap, int key, double SWDfrac, double DWDfrac, double litterFrac, double soilFrac)
hacky access function to resource units covered by a polygon.
Definition: management.cpp:522
double removeStem
Definition: management.h:37
int killPct(int pctfrom, int pctto, int number)
kill "number" of stems in the percentile interval "from" - "to".
Definition: management.cpp:296
int filter(QString filter)
apply a filter on the list of trees (expression), return number of remaining trees.
Definition: management.cpp:382
QJSValue treeObject(int index)
return a copy of a tree
Definition: management.cpp:349
int count
Definition: management.h:34
int count() const
return number of trees currently in list
Definition: management.h:57
int loadResourceUnit(int ruindex)
load all trees of a resource index
Definition: management.cpp:412
double removeFoliage
Definition: management.h:35
void killSaplingsResourceUnit(int ruindex)
kill all saplings that are on a given resource unit (given by 'ruindex')
Definition: management.cpp:504
int manageAll()
manage all trees in the list
Definition: management.cpp:307
int loadAll()
load all trees, return number of trees
Definition: management.h:102
int killAll()
kill all trees in the list
Definition: management.cpp:98
void killSaplings(MapGridWrapper *wrap, int key, QString filter=QString())
kill all saplings that are on the area denoted by 'key' of the given grid (script access)
Definition: management.cpp:468
QString scriptFile() const
Definition: management.h:43
void cutAndDrop()
kill trees, cut down to the ground
Definition: management.cpp:145
double removeStem() const
removal fraction stem biomass: 0: 0% will be removed, 1: 100% will be removed from the forest by mana...
Definition: management.h:51
void run()
Definition: management.cpp:320
int manage(QString filter, double fraction)
manage 'fraction' of all trees with 'filter'=true
Definition: management.cpp:140
double mean(QString expression, QString filter=QString())
calculate the mean value for all trees in the internal list for 'expression' (filtered by the filter ...
Definition: management.h:66
double percentile(int pct)
get value for the pct th percentile (1..100)
Definition: management.cpp:604
int kill(QString filter, double fraction)
kill 'fraction' of all trees with 'filter'=true
Definition: management.cpp:136
QJSValue tree(int index)
access to single trees (returns a reference)
Definition: management.cpp:340
int remain(int number)
remove randomly trees until only 'number' of trees remain.
Definition: management.cpp:78
Management()
Definition: management.cpp:55
double removeBranch
Definition: management.h:36
int filterIdList(QVariantList idList)
apply filter in form of a list of ids, return number of remaining trees
Definition: management.cpp:361
Definition: scriptglobal.h:31
Definition: scripttree.h:10
A tree is the basic simulation entity of iLand and represents a single tree.
Definition: tree.h:44