47 void setSimulate(
bool do_simulate) {mOnlySimulate = do_simulate; }
48 int count()
const {
return mTrees.count(); }
57 const QVector<QPair<Tree*, double> >
trees()
const {
return mTrees; }
86 QJSValue
tree(
int index);
126 void sort(QString statement);
132 double mean(QString expression, QString
filter=QString()) {
return aggregate_function( expression,
filter,
"mean"); }
134 double sum(QString expression, QString
filter=QString()) {
return aggregate_function( expression,
filter,
"sum"); }
145 double meanSaplings(QString expression, QString
filter=QString()) {
return aggregate_function_sapling(expression,
filter,
"mean"); }
147 double sumSaplings(QString expression, QString
filter=QString()) {
return aggregate_function_sapling(expression,
filter,
"sum"); }
154 int remove_percentiles(
int pctfrom,
int pctto,
int number,
bool management);
155 int remove_trees(QString expression,
double fraction,
bool management);
156 double aggregate_function(QString expression, QString
filter, QString type);
157 double aggregate_function_sapling(QString expression, QString
filter, QString type);
158 bool remove_single_tree(
int index,
bool harvest=
true);
166 void runGrid(
void (*func)(
float &,
int &,
const Tree *,
const FMTreeList *) );
168 QVector<QPair<Tree*, double> > mTrees;
169 bool mResourceUnitsLocked;
180 double *mRunGridCustomCell;
The ActThinning class implements a very general interface to thinning activties.
Definition: actthinning.h:34
FMStand encapsulates a forest stand for the forest management engine.
Definition: fmstand.h:49
The FMTreeList class implements low-level functionality for selecting and harvesting of trees.
Definition: fmtreelist.h:34
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: fmtreelist.h:132
int killSaplings(QString expression)
modify sapling
Definition: fmtreelist.cpp:685
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: fmtreelist.h:134
int loadFromRect(ResourceUnit *ru, const QRectF &rect)
load trees from a portion of a RU
Definition: fmtreelist.cpp:95
void randomize()
random shuffle of all trees in the list
Definition: fmtreelist.cpp:548
int spatialFilter(QJSValue grid, QString filter)
spatial filter within the stand trees are kept in the list if the expession 'filter' returns true for...
Definition: fmtreelist.cpp:179
const QVector< QPair< Tree *, double > > trees() const
access the list of trees
Definition: fmtreelist.h:57
FMTreeList(QObject *parent=0)
Definition: fmtreelist.cpp:52
void prepareStandGrid(QString type, QString custom_expression=QString())
set up internally a map (10m grid cells) of the stand with a given grid type or using a custom expres...
Definition: fmtreelist.cpp:650
Grid< float > & localGrid()
access to local grid (setup if necessary)
Definition: fmtreelist.h:60
int filter(QString filter)
apply a filter on the current tree list.
Definition: fmtreelist.cpp:158
double sumSaplings(QString expression, QString filter=QString())
calculate the sum for all trees in the internal list for the 'expression' (filtered by the filter cri...
Definition: fmtreelist.h:147
int kill(QString filter=QString())
kill "number" of stems in the percentile interval "from" - "to".
Definition: fmtreelist.cpp:274
friend void rungrid_custom(float &cell, int &n, const Tree *tree, const FMTreeList *list)
Definition: fmtreelist.cpp:641
int load(const QString &filter)
load all trees passing the filter, return number of trees (load only living trees)
Definition: fmtreelist.cpp:121
FloatGrid & standGrid()
Definition: fmtreelist.h:140
bool simulate
if 'simulate' is true, trees are only marked for removal
Definition: fmtreelist.h:38
void setSimulate(bool do_simulate)
Definition: fmtreelist.h:47
void setStand(FMStand *stand)
Definition: fmtreelist.cpp:78
void exportStandGrid(QString file_name)
Definition: fmtreelist.cpp:678
bool simulate() const
Definition: fmtreelist.h:46
int loadAll()
load all trees of the stand, return number of trees (living trees)
Definition: fmtreelist.h:67
QJSValue tree(int index)
access to single trees (returns a reference)
Definition: fmtreelist.cpp:251
int count() const
Definition: fmtreelist.h:48
int removeMarkedTrees()
load all trees of the stand and either kill or harvest trees that are marked for that operation.
Definition: fmtreelist.cpp:217
~FMTreeList()
Definition: fmtreelist.cpp:73
double percentile(int pct)
get value for the pct th percentile (1..100)
Definition: fmtreelist.cpp:534
void sort(QString statement)
hacky access function to resource units covered by a polygon.
Definition: fmtreelist.cpp:521
int stand
return stand, -1 if not set
Definition: fmtreelist.h:36
int resetMarks()
reset all marks of currently loaded trees to zero
Definition: fmtreelist.cpp:237
int standId() const
Definition: fmtreelist.h:44
QJSValue treeObject(int index)
return a copy of a tree
Definition: fmtreelist.cpp:261
int count
return the number of trees that are currently loaded
Definition: fmtreelist.h:37
int harvest(QString filter=QString(), double fraction=1.)
manage 'fraction' of all trees [0..1] with 'filter'.
Definition: fmtreelist.cpp:279
double meanSaplings(QString expression, QString filter=QString())
calculate the mean value for all trees in the internal list for 'expression' (filtered by the filter ...
Definition: fmtreelist.h:145
int loadFromRU(ResourceUnit *ru, bool append=false)
load all trees from a RU
Definition: fmtreelist.cpp:106
An expression engine for mathematical expressions provided as strings.
Definition: expression.h:29
ResourceUnit is the spatial unit that encapsulates a forest stand and links to several environmental ...
Definition: resourceunit.h:49
Definition: scripttree.h:10
A tree is the basic simulation entity of iLand and represents a single tree.
Definition: tree.h:44