iLand
Public Slots | Public Member Functions | Properties | List of all members
Management Class Reference

management routines. More...

#include <management.h>

Inheritance diagram for Management:

Public Slots

QJSValue tree (int index)
 access to single trees (returns a reference) More...
 
QJSValue treeObject (int index)
 return a copy of a tree More...
 
double mean (QString expression, QString filter=QString())
 calculate the mean value for all trees in the internal list for 'expression' (filtered by the filter criterion) More...
 
double sum (QString expression, QString filter=QString())
 calculate the sum for all trees in the internal list for the 'expression' (filtered by the filter criterion) More...
 
int remain (int number)
 remove randomly trees until only 'number' of trees remain. More...
 
int killPct (int pctfrom, int pctto, int number)
 kill "number" of stems in the percentile interval "from" - "to". More...
 
int killAll ()
 kill all trees in the list More...
 
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) More...
 
int kill (QString filter, double fraction)
 kill 'fraction' of all trees with 'filter'=true More...
 
int managePct (int pctfrom, int pctto, int number)
 kill "number" of stems in the percentile interval "from" - "to". More...
 
int manageAll ()
 manage all trees in the list More...
 
int manage (QString filter, double fraction)
 manage 'fraction' of all trees with 'filter'=true More...
 
void cutAndDrop ()
 kill trees, cut down to the ground More...
 
double percentile (int pct)
 get value for the pct th percentile (1..100) More...
 
int loadAll ()
 load all trees, return number of trees More...
 
int load (QString filter)
 load all trees passing the filter in a list, return number of trees More...
 
int loadResourceUnit (int ruindex)
 load all trees of a resource index More...
 
void loadFromTreeList (QList< Tree * >tree_list)
 load a previously present tree list More...
 
void loadFromMap (const MapGrid *map_grid, int key)
 load all trees that are on the area denoted by 'key' of the given grid More...
 
int loadFromMap (MapGridWrapper *wrap, int key)
 load all trees that are on the area denoted by 'key' of the given grid (script access) More...
 
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) More...
 
void killSaplingsResourceUnit (int ruindex)
 kill all saplings that are on a given resource unit (given by 'ruindex') More...
 
void removeSoilCarbon (MapGridWrapper *wrap, int key, double SWDfrac, double DWDfrac, double litterFrac, double soilFrac)
 hacky access function to resource units covered by a polygon. More...
 
void slashSnags (MapGridWrapper *wrap, int key, double slash_fraction)
 slash snags (SWD and otherWood-Pools) of polygon 'key' on the map 'wrap'. More...
 
void sort (QString statement)
 sort trees in the list according to a criterion More...
 
int filter (QString filter)
 apply a filter on the list of trees (expression), return number of remaining trees. More...
 
int filterIdList (QVariantList idList)
 apply filter in form of a list of ids, return number of remaining trees More...
 
void randomize ()
 random shuffle of all trees in the list More...
 

Public Member Functions

 Management ()
 
 ~Management ()
 
void run ()
 
void loadScript (const QString &fileName)
 
QString scriptFile () const
 
double removeFoliage () const
 removal fraction foliage: 0: 0% will be removed, 1: 100% will be removed from the forest by management operations (i.e. calls to manage() instead of kill()) More...
 
double removeBranch () const
 removal fraction branch biomass: 0: 0% will be removed, 1: 100% will be removed from the forest by management operations (i.e. calls to manage() instead of kill()) More...
 
double removeStem () const
 removal fraction stem biomass: 0: 0% will be removed, 1: 100% will be removed from the forest by management operations (i.e. calls to manage() instead of kill()) More...
 
void setRemoveFoliage (const double fraction)
 
void setRemoveBranch (const double fraction)
 
void setRemoveStem (const double fraction)
 
int count () const
 return number of trees currently in list More...
 

Properties

int count
 
double removeFoliage
 
double removeBranch
 
double removeStem
 

Detailed Description

management routines.

The actual iLand management is based on Javascript functions. This class provides the frame for executing the javascript as well as the functions that are called by scripts and that really do the work. See http://iland-model.org/iLand+scripting, http://iland-model.org/Object+Management for management Javascript API.

Constructor & Destructor Documentation

◆ Management()

Management::Management ( )

◆ ~Management()

Management::~Management ( )

Member Function Documentation

◆ count()

int Management::count ( ) const
inline

return number of trees currently in list

◆ cutAndDrop

void Management::cutAndDrop ( )
slot

kill trees, cut down to the ground

◆ disturbanceKill

int Management::disturbanceKill ( double  stem_to_soil_fraction,
double  stem_to_snag_fraction,
double  branch_to_soil_fraction,
double  branch_to_snag_fraction,
QString  agent 
)
slot

kill all trees (disturbance related)

Parameters
stem_to_soil_fraction(0..1) of stem biomass that is routed to the soil
stem_to_snag_fraction(0..1) of the stem biomass continues as standing dead
branch_to_soil_fraction(0..1) of branch biomass that is routed to the soil
branch_to_snag_fraction(0..1) of the branch biomass continues as standing dead
foliage_to_soil_fraciton(0..1) fraction of biomass that goes directly to the soil. The rest (1.-fraction) is removed.
agent(string): disturbance agent ('fire' 'wind', 'bb', ...)

◆ filter

int Management::filter ( QString  filter)
slot

apply a filter on the list of trees (expression), return number of remaining trees.

◆ filterIdList

int Management::filterIdList ( QVariantList  idList)
slot

apply filter in form of a list of ids, return number of remaining trees

◆ kill

int Management::kill ( QString  filter,
double  fraction 
)
slot

kill 'fraction' of all trees with 'filter'=true

◆ killAll

int Management::killAll ( )
slot

kill all trees in the list

◆ killPct

int Management::killPct ( int  pctfrom,
int  pctto,
int  number 
)
slot

kill "number" of stems in the percentile interval "from" - "to".

remove all if "number" is higher than the count. return the number of removed trees.

◆ killSaplings

void Management::killSaplings ( MapGridWrapper wrap,
int  key,
QString  filter = QString() 
)
slot

kill all saplings that are on the area denoted by 'key' of the given grid (script access)

◆ killSaplingsResourceUnit

void Management::killSaplingsResourceUnit ( int  ruindex)
slot

kill all saplings that are on a given resource unit (given by 'ruindex')

◆ load

int Management::load ( QString  filter)
slot

load all trees passing the filter in a list, return number of trees

◆ loadAll

int Management::loadAll ( )
inlineslot

load all trees, return number of trees

◆ loadFromMap [1/2]

void Management::loadFromMap ( const MapGrid map_grid,
int  key 
)
slot

load all trees that are on the area denoted by 'key' of the given grid

loadFromMap selects trees located on pixels with value 'key' within the grid 'map_grid'.

◆ loadFromMap [2/2]

int Management::loadFromMap ( MapGridWrapper wrap,
int  key 
)
slot

load all trees that are on the area denoted by 'key' of the given grid (script access)

◆ loadFromTreeList

void Management::loadFromTreeList ( QList< Tree * >  tree_list)
slot

load a previously present tree list

◆ loadResourceUnit

int Management::loadResourceUnit ( int  ruindex)
slot

load all trees of a resource index

◆ loadScript()

void Management::loadScript ( const QString &  fileName)

◆ manage

int Management::manage ( QString  filter,
double  fraction 
)
slot

manage 'fraction' of all trees with 'filter'=true

◆ manageAll

int Management::manageAll ( )
slot

manage all trees in the list

◆ managePct

int Management::managePct ( int  pctfrom,
int  pctto,
int  number 
)
slot

kill "number" of stems in the percentile interval "from" - "to".

remove all if "number" is higher than the count. Use the removal fractions set by the removeStem, removeBranch and removeFoliage properties. return the number of removed trees.

◆ mean

double Management::mean ( QString  expression,
QString  filter = QString() 
)
inlineslot

calculate the mean value for all trees in the internal list for 'expression' (filtered by the filter criterion)

◆ percentile

double Management::percentile ( int  pct)
slot

get value for the pct th percentile (1..100)

◆ randomize

void Management::randomize ( )
slot

random shuffle of all trees in the list

◆ remain

int Management::remain ( int  number)
slot

remove randomly trees until only 'number' of trees remain.

return number of removed trees

◆ removeBranch()

double Management::removeBranch ( ) const
inline

removal fraction branch biomass: 0: 0% will be removed, 1: 100% will be removed from the forest by management operations (i.e. calls to manage() instead of kill())

◆ removeFoliage()

double Management::removeFoliage ( ) const
inline

removal fraction foliage: 0: 0% will be removed, 1: 100% will be removed from the forest by management operations (i.e. calls to manage() instead of kill())

◆ removeSoilCarbon

void Management::removeSoilCarbon ( MapGridWrapper wrap,
int  key,
double  SWDfrac,
double  DWDfrac,
double  litterFrac,
double  soilFrac 
)
slot

hacky access function to resource units covered by a polygon.

specify removal fractions

the parameters are "remove-fractions": i.e. value=0: no change, value=1: set to zero.

Parameters
SWDFrac0: no change, 1: remove all of standing woody debris
DWDfrac0: no change, 1: remove all of downed woody debris
litterFrac0: no change, 1: remove all of soil litter
soilFrac0: no change, 1: remove all of soil organic matter

◆ removeStem()

double Management::removeStem ( ) const
inline

removal fraction stem biomass: 0: 0% will be removed, 1: 100% will be removed from the forest by management operations (i.e. calls to manage() instead of kill())

◆ run()

void Management::run ( )

◆ scriptFile()

QString Management::scriptFile ( ) const
inline

◆ setRemoveBranch()

void Management::setRemoveBranch ( const double  fraction)
inline

◆ setRemoveFoliage()

void Management::setRemoveFoliage ( const double  fraction)
inline

◆ setRemoveStem()

void Management::setRemoveStem ( const double  fraction)
inline

◆ slashSnags

void Management::slashSnags ( MapGridWrapper wrap,
int  key,
double  slash_fraction 
)
slot

slash snags (SWD and otherWood-Pools) of polygon 'key' on the map 'wrap'.

slash snags (SWD and otherWood-Pools) of polygon key on the map wrap.

Parameters
slash_fraction0: no change, 1: 100%

The factor is scaled to the overlapping area of key on the resource unit.

Parameters
wrapMapGrid to use together with key
keyID of the polygon.
slash_fraction0: no change, 1: 100%

◆ sort

void Management::sort ( QString  statement)
slot

sort trees in the list according to a criterion

◆ sum

double Management::sum ( QString  expression,
QString  filter = QString() 
)
inlineslot

calculate the sum for all trees in the internal list for the 'expression' (filtered by the filter criterion)

◆ tree

QJSValue Management::tree ( int  index)
slot

access to single trees (returns a reference)

◆ treeObject

QJSValue Management::treeObject ( int  index)
slot

return a copy of a tree

Property Documentation

◆ count

int Management::count
read

◆ removeBranch

double Management::removeBranch
readwrite

◆ removeFoliage

double Management::removeFoliage
readwrite

◆ removeStem

double Management::removeStem
readwrite

The documentation for this class was generated from the following files: