93 void setup(QJSValue obj);
100 const QVector<ResourceUnit*> &
largeCellRUs(
int cellindex) {
return mRULookup[cellindex]; }
104 QString
name()
const {
return mName; }
159 void saveGrid(QString expression, QString file_name);
162 static QHash<QThread*, ABE::FMTreeList* > mTreeLists;
163 static QHash<QThread*, ABE::FMSaplingList* > mSaplingLists;
165 void setupScripting();
173 void createBaseGrid();
175 QVector<BiteCell> mCells;
186 QJSValueList mTreeRemovedParams;
189 QVector<BiteItem*> mItems;
192 QHash<int, QVector<ResourceUnit*> > mRULookup;
200 int mOnTreeRemovedFilter;
204 QJSValue mScriptCell;
207 QVector<Grid<double> *> mCreatedVarGrids;
Definition: fmsaplinglist.h:12
The FMTreeList class implements low-level functionality for selecting and harvesting of trees.
Definition: fmtreelist.h:34
Definition: biteagent.h:71
QString name() const
(short) name of the agent
Definition: biteagent.h:104
QString description
Definition: biteagent.h:74
BiteLifeCycle * lifeCycle() const
Definition: biteagent.h:127
BAgentStats & stats()
Definition: biteagent.h:126
int width
Definition: biteagent.h:76
int height() const
Definition: biteagent.h:110
int cellSize() const
cell size in meters
Definition: biteagent.h:108
QStringList variables
Definition: biteagent.h:80
QString description() const
(user defined) description of the agent
Definition: biteagent.h:106
void notifyItems(BiteCell *cell, BiteCell::ENotification what)
Definition: biteagent.cpp:145
int height
Definition: biteagent.h:77
void run()
Definition: biteagent.cpp:213
void addVariable(ScriptGrid *grid, QString var_name)
add an existing grid (e.g. from file) as an agent variable
Definition: biteagent.cpp:288
bool verbose() const
Definition: biteagent.h:115
void setup(QJSValue obj)
setup of the agent with a data structure (provided via JS)
Definition: biteagent.cpp:61
const Grid< BiteCell * > & grid() const
Definition: biteagent.h:123
int onTreeRemovedFilter
Definition: biteagent.h:81
BiteAgent(QObject *parent=nullptr)
Definition: biteagent.cpp:37
void setLargeCellRuList(int cellindex, QVector< ResourceUnit * > &list)
Definition: biteagent.cpp:154
void saveGrid(QString expression, QString file_name)
evaluate 'expression' for each cell, update the internal drawing grid, and save the content to 'file_...
Definition: biteagent.cpp:392
const BiteClimate & biteClimate() const
Definition: biteagent.h:97
BiteItem * item(QString name)
elements of the agent
Definition: biteagent.cpp:260
BiteCellScript * cell(int x, int y)
Definition: biteagent.cpp:469
static ABE::FMSaplingList * threadSaplingList()
Definition: biteagent.cpp:447
void runOnTreeRemovedFilter(Tree *tree, int reason)
Definition: biteagent.cpp:195
void updateVariable(QString var_name, double value)
set the value of var_name to value for all cells
Definition: biteagent.cpp:307
ScriptGrid * drawGrid
Definition: biteagent.h:79
static ABE::FMTreeList * threadTreeList()
Definition: biteagent.cpp:437
static void setCPPOwnership(QObject *obj)
helper function to set C++ ownership for 'obj'
Definition: biteagent.cpp:140
void createStatsGrid()
create stats grid (on demand)
Definition: biteagent.cpp:457
void setOnTreeRemovedFilter(int value)
Definition: biteagent.cpp:167
Grid< double > * baseDrawGrid()
Definition: biteagent.h:89
QString info()
Definition: biteagent.cpp:268
void updateDrawGrid(QString expression)
evaluate 'expression' for each cell and update the internal drawing grid
Definition: biteagent.cpp:361
QString name
Definition: biteagent.h:73
ScriptGrid * drawGrid()
Definition: biteagent.h:88
int onTreeRemovedFilter() const
Definition: biteagent.h:119
void setVerbose(bool v)
Definition: biteagent.h:116
int cellSize
Definition: biteagent.h:75
bool isCellValid(int x, int y)
returns true, if a valid cell is at x/y
Definition: biteagent.h:137
const QVector< ResourceUnit * > & largeCellRUs(int cellindex)
Definition: biteagent.h:100
double evaluate(BiteCellScript *cell, QString expr)
Definition: biteagent.cpp:280
~BiteAgent()
Definition: biteagent.cpp:50
BACellStat * cellStat(const BiteCell *cell)
return the cell statistics (if available) for the given 'cell'
Definition: biteagent.cpp:462
int width() const
Definition: biteagent.h:109
bool verbose
Definition: biteagent.h:78
BiteWrapperCore * wrapper()
Definition: biteagent.h:96
Definition: bitecell.h:38
ENotification
Definition: bitecell.h:71
Definition: bitecellscript.h:37
Definition: biteclimate.h:31
Definition: biteitem.h:37
Definition: bitelifecycle.h:28
Definition: bitewrapper.h:31
Definition: bitecellscript.h:88
Grid class (template).
Definition: grid.h:44
Definition: scriptgrid.h:29
Definition: scripttree.h:10
A tree is the basic simulation entity of iLand and represents a single tree.
Definition: tree.h:44
Definition: biteagent.cpp:32
Definition: biteagent.h:55
int nHostSaplings
number of saplings (cohorts) that are potential hosts
Definition: biteagent.h:62
int saplingsImpact
number of saplings affected (e.g. by browsing) (<4m)
Definition: biteagent.h:64
double totalImpact
impact on tree compartments (depending on the mode)
Definition: biteagent.h:61
int nKilled
number of trees (>4m) killed
Definition: biteagent.h:58
BACellStat()
Definition: biteagent.h:56
int saplingsKilled
number of saplings (cohorts) killed (<4m)
Definition: biteagent.h:63
void clear()
Definition: biteagent.h:57
int nHostTrees
number of trees (>4m) that are potential host trees (hostFilter)
Definition: biteagent.h:59
double m3Killed
volume of all killed trees (>4m)
Definition: biteagent.h:60
Definition: biteagent.h:40
double m3Killed
volume of all killed trees (>4m)
Definition: biteagent.h:49
int nColonizable
number of cells that are tested for colonization
Definition: biteagent.h:44
int nDispersal
number of cells that are active source of dispersal
Definition: biteagent.h:43
int treesKilled
number of all killed trees (>4m)
Definition: biteagent.h:48
int saplingsKilled
number of saplings (cohorts) killed (<4m)
Definition: biteagent.h:51
int nNewlyColonized
number of cells that are colonized (successfully)
Definition: biteagent.h:46
int nActive
number of cells that are active at the end of the year
Definition: biteagent.h:45
int saplingsImpact
number of saplings affected (e.g. by browsing) (<4m)
Definition: biteagent.h:52
double agentBiomass
total agent biomass in all active cells
Definition: biteagent.h:47
BAgentStats()
Definition: biteagent.h:41
void clear()
Definition: biteagent.h:42
double totalImpact
impact on tree compartments (depending on the mode)
Definition: biteagent.h:50