38class ForestManagementEngine;
48namespace BITE {
class BiteEngine; }
53 int count()
const {
return mCount & 0x0000ffff; }
66 float stemHeight()
const {
return static_cast<float> (mCount >> 20 & 0xff);}
70 void setStemHeight(
float h) {
unsigned int hval =
static_cast<unsigned int>(h + 0.5f);
71 unsigned int w = mCount;
76 void init(
const float aheight,
const int acount) {
height=aheight;mCount=
static_cast<unsigned int>(acount); }
101 const QRectF &
extent()
const {
return mModelRect; }
105 ResourceUnit *
ru(
int index) {
return (index>=0&&index<mRU.count())? mRU[index] : NULL; }
108 const QList<ResourceUnit*> &
ruList()
const {
return mRU; }
120 const QList<Climate*>
climates()
const {
return mClimates; }
154 void initOutputDatabase();
160 void calculateStockedArea();
161 void calculateStockableArea();
162 void initializeGrid();
165 void debugCheckAllTrees();
166 bool multithreading()
const {
return threadRunner.
multithreading(); }
169 QString mCurrentTask;
172 QList<ResourceUnit*> mRU;
176 QList<SpeciesSet*> mSpeciesSets;
178 QList<Climate*> mClimates;
183 double mTotalStockableArea;
206 void reset() { mTreeEnd=0; mCurrent=0; }
216 QList<ResourceUnit*>::const_iterator mRUIterator;
the ForestManagementEngine is the container for the agent based forest management engine.
Definition: forestmanagementengine.h:43
Tree * operator*() const
Definition: model.h:210
Tree * current() const
Definition: model.cpp:115
Tree * next()
iterate over all trees of the model.
Definition: model.cpp:72
ResourceUnit * currentRU() const
Definition: model.h:211
AllTreeIterator(Model *model)
Definition: model.h:205
void reset()
Definition: model.h:206
Tree * nextLiving()
Definition: model.cpp:109
Definition: biteengine.h:30
Climate handles climate input data and performs some basic related calculations on that data.
Definition: climate.h:66
DEM is a digital elevation model class.
Definition: dem.h:40
Environment specifes the geographical properties of the landscape.
Definition: environment.h:34
The GrassCover class specifies the limiting effect of ground vegetation (grasses, herbs) on the regen...
Definition: grasscover.h:39
Grid class (template).
Definition: grid.h:44
const T & constValueAtIndex(const QPoint &pos) const
value at position defined by a (integer) QPoint
Definition: grid.h:109
QPoint indexOf(const int index) const
get index (x/y) of the (linear) index 'index' (0..count-1)
Definition: grid.h:127
management routines.
Definition: management.h:32
Main object of the iLand model composited of various sub models / sub components.
Definition: model.h:90
Management * management() const
Definition: model.h:109
void afterStop()
finish and cleanup
Definition: model.cpp:945
GrassCover * grassCover() const
Definition: model.h:118
void createStandStatistics()
build stand statistics (i.e. stats based on resource units)
Definition: model.cpp:1249
const Grid< ResourceUnit * > & RUgrid()
Definition: model.h:127
SVDStates * svdStates() const
Definition: model.h:121
ResourceUnit * ru(int index)
get resource unit by index
Definition: model.h:105
const MapGrid * standGrid()
retrieve the spatial grid that defines the stands (10m resolution)
Definition: model.h:126
static ModelSettings & changeSettings()
write access to global model settings.
Definition: model.h:137
void reloadABE()
force a recreate of the agent based forest management engine
Definition: model.cpp:592
void executePerResourceUnit(void(*funcptr)(ResourceUnit *), const bool forceSingleThreaded=false)
execute a function for each resource unit using multiple threads. "funcptr" is a ptr to a simple func...
Definition: model.h:149
BITE::BiteEngine * biteEngine() const
Definition: model.h:111
HeightGrid * heightGrid()
stores maximum heights of trees and some flags (currently 10x10m)
Definition: model.h:125
const ThreadRunner & threadExec() const
Definition: model.h:100
bool isSetup() const
return true if the model world is correctly setup.
Definition: model.h:135
ResourceUnit * ru()
Definition: model.h:103
FloatGrid * grid()
this is the global 'LIF'-grid (light patterns) (currently 2x2m)
Definition: model.h:124
void clear()
free ressources
Definition: model.cpp:416
void beforeRun()
initializations
Definition: model.cpp:689
const HeightGridValue & heightGridValue(const float *lif_ptr) const
Definition: model.h:130
void loadProject()
setup and load a project
Definition: model.cpp:479
ABE::ForestManagementEngine * ABEngine() const
Definition: model.h:110
Environment * environment() const
Definition: model.h:113
const HeightGridValue heightGridValue(const int ix, const int iy) const
get the value of the (10m) Height grid at the position index ix and iy (of the LIF grid)
Definition: model.h:129
double totalStockableArea() const
total stockable area of the landscape (ha)
Definition: model.h:102
void runYear()
run a single year
Definition: model.cpp:778
ResourceUnit * ruById(int id) const
find the resource unit with Id 'id' or return NULL
Definition: model.cpp:619
TimeEvents * timeEvents() const
Definition: model.h:115
void setCurrentTask(QString what)
Definition: model.h:141
const DEM * dem() const
Definition: model.h:117
const QList< Climate * > climates() const
Definition: model.h:120
~Model()
Definition: model.cpp:132
Model()
Definition: model.cpp:122
SpeciesSet * speciesSet() const
Definition: model.h:119
Saplings * saplings() const
Definition: model.h:114
Modules * modules() const
Definition: model.h:116
void cleanTreeLists(bool recalculate_stats)
clean the tree data structures (remove harvested trees) - call after management operations.
Definition: model.cpp:1258
static const ModelSettings & settings()
access to global model settings.
Definition: model.h:136
const QList< ResourceUnit * > & ruList() const
ruList contains all simulated resource units (that are in the project area)
Definition: model.h:108
QString currentTask() const
Definition: model.h:140
void onlyApplyLightPattern()
Definition: model.h:138
const QRectF & extent() const
extent of the model (without buffer)
Definition: model.h:101
Definition: modelsettings.h:25
The Modules class is the container for iLand modules (e.g.
Definition: modules.h:35
ResourceUnit is the spatial unit that encapsulates a forest stand and links to several environmental ...
Definition: resourceunit.h:49
Definition: svdstate.h:49
The Saplings class the container for the establishment and sapling growth in iLand.
Definition: saplings.h:192
A SpeciesSet acts as a container for individual Species objects.
Definition: speciesset.h:30
Encapsulates the invokation of multiple threads for paralellized tasks.
Definition: threadrunner.h:27
bool multithreading() const
Definition: threadrunner.h:35
void run(void(*funcptr)(ResourceUnit *), const bool forceSingleThreaded=false) const
execute 'funcptr' for all resource units in parallel
Definition: threadrunner.cpp:60
Definition: timeevents.h:25
A tree is the basic simulation entity of iLand and represents a single tree.
Definition: tree.h:44
const int cPxPerHeight
Definition: globalsettings.h:9
bool isBitSet(const unsigned int value, const int bit)
Definition: global.h:97
void setBit(unsigned int &rTarget, const int bit, const bool value)
Definition: global.h:90
Grid< HeightGridValue > HeightGrid
Definition: model.h:87
Definition: biteagent.cpp:32
float height
dominant tree height (m)
Definition: model.h:52
bool isRadiating() const
Definition: model.h:64
void setValid(const bool valid)
set bit to 1: pixel is not valid
Definition: model.h:60
void clearStemHeight()
reset the stem height
Definition: model.h:68
float stemHeight() const
get the (coarse, 1m classes) local height (only trees with the stem on the cell are counted here)
Definition: model.h:66
void setForestOutside(const bool is_outside)
Definition: model.h:61
bool isValid() const
a value of 1: not valid (returns false).
Definition: model.h:59
void increaseCount()
increase the number of trees on pixel
Definition: model.h:54
bool isForestOutside() const
true if a pixel is outside of the project area but considered as forested
Definition: model.h:62
void init(const float aheight, const int acount)
set values for height and count (this overwrites all the flags!)
Definition: model.h:76
void setIsRadiating()
bit 18: if set, the pixel is actively radiating influence on the LIF (such pixels are on the edge of ...
Definition: model.h:63
void setStemHeight(float h)
set the height of the tree local (i.e. the stem of the tree is on the pixel); compare to the 'height'...
Definition: model.h:70
int count() const
get count of trees on pixel
Definition: model.h:53
void resetCount()
set the count to 0
Definition: model.h:55