iLand
Public Slots | Public Member Functions | Static Public Member Functions | Properties | List of all members
BITE::BiteAgent Class Reference

#include <biteagent.h>

Inheritance diagram for BITE::BiteAgent:

Public Slots

BiteCellScriptcell (int x, int y)
 
bool isCellValid (int x, int y)
 returns true, if a valid cell is at x/y More...
 
void run ()
 
void run (BiteCellScript *cell)
 
BiteItemitem (QString name)
 elements of the agent More...
 
QString info ()
 
double evaluate (BiteCellScript *cell, QString expr)
 
void addVariable (ScriptGrid *grid, QString var_name)
 add an existing grid (e.g. from file) as an agent variable More...
 
void addVariable (QString var_name)
 add a variable (=Grid<double>) with the name 'var_name' More...
 
void updateVariable (QString var_name, double value)
 set the value of var_name to value for all cells More...
 
void updateVariable (QString var_name, QString expression)
 set the value of var_name to the result of 'expression' for all cells More...
 
void updateVariable (QString var_name, QJSValue func)
 set the value of var_name to the result of the javascript function func (evaluated with cell context) More...
 
void updateDrawGrid (QString expression)
 evaluate 'expression' for each cell and update the internal drawing grid More...
 
void updateDrawGrid (QJSValue func)
 
void saveGrid (QString expression, QString file_name)
 evaluate 'expression' for each cell, update the internal drawing grid, and save the content to 'file_name' More...
 

Public Member Functions

 BiteAgent (QObject *parent=nullptr)
 
Q_INVOKABLE BiteAgent (QJSValue obj)
 
 ~BiteAgent ()
 
ScriptGriddrawGrid ()
 
Grid< double > * baseDrawGrid ()
 
void setup (QJSValue obj)
 setup of the agent with a data structure (provided via JS) More...
 
BiteWrapperCorewrapper ()
 
const BiteClimatebiteClimate () const
 
void notifyItems (BiteCell *cell, BiteCell::ENotification what)
 
const QVector< ResourceUnit * > & largeCellRUs (int cellindex)
 
void setLargeCellRuList (int cellindex, QVector< ResourceUnit * > &list)
 
QString name () const
 (short) name of the agent More...
 
QString description () const
 (user defined) description of the agent More...
 
int cellSize () const
 cell size in meters More...
 
int width () const
 
int height () const
 
QStringList variables ()
 
bool verbose () const
 
void setVerbose (bool v)
 
int onTreeRemovedFilter () const
 
void setOnTreeRemovedFilter (int value)
 
void runOnTreeRemovedFilter (Tree *tree, int reason)
 
const Grid< BiteCell * > & grid () const
 
BAgentStatsstats ()
 
BiteLifeCyclelifeCycle () const
 
void createStatsGrid ()
 create stats grid (on demand) More...
 
BACellStatcellStat (const BiteCell *cell)
 return the cell statistics (if available) for the given 'cell' More...
 

Static Public Member Functions

static void setCPPOwnership (QObject *obj)
 helper function to set C++ ownership for 'obj' More...
 
static ABE::FMTreeListthreadTreeList ()
 
static ABE::FMSaplingListthreadSaplingList ()
 

Properties

QString name
 
QString description
 
int cellSize
 
int width
 
int height
 
bool verbose
 
ScriptGriddrawGrid
 
QStringList variables
 
int onTreeRemovedFilter
 

Constructor & Destructor Documentation

◆ BiteAgent() [1/2]

BITE::BiteAgent::BiteAgent ( QObject *  parent = nullptr)

◆ BiteAgent() [2/2]

BITE::BiteAgent::BiteAgent ( QJSValue  obj)

◆ ~BiteAgent()

BITE::BiteAgent::~BiteAgent ( )

Member Function Documentation

◆ addVariable [1/2]

void BITE::BiteAgent::addVariable ( QString  var_name)
slot

add a variable (=Grid<double>) with the name 'var_name'

◆ addVariable [2/2]

void BITE::BiteAgent::addVariable ( ScriptGrid grid,
QString  var_name 
)
slot

add an existing grid (e.g. from file) as an agent variable

◆ baseDrawGrid()

Grid< double > * BITE::BiteAgent::baseDrawGrid ( )
inline

◆ biteClimate()

const BiteClimate & BITE::BiteAgent::biteClimate ( ) const
inline

◆ cell

BiteCellScript * BITE::BiteAgent::cell ( int  x,
int  y 
)
slot

◆ cellSize()

int BITE::BiteAgent::cellSize ( ) const
inline

cell size in meters

◆ cellStat()

BACellStat * BITE::BiteAgent::cellStat ( const BiteCell cell)

return the cell statistics (if available) for the given 'cell'

◆ createStatsGrid()

void BITE::BiteAgent::createStatsGrid ( )

create stats grid (on demand)

◆ description()

QString BITE::BiteAgent::description ( ) const
inline

(user defined) description of the agent

◆ drawGrid()

ScriptGrid * BITE::BiteAgent::drawGrid ( )
inline

◆ evaluate

double BITE::BiteAgent::evaluate ( BiteCellScript cell,
QString  expr 
)
slot

◆ grid()

const Grid< BiteCell * > & BITE::BiteAgent::grid ( ) const
inline

◆ height()

int BITE::BiteAgent::height ( ) const
inline

◆ info

QString BITE::BiteAgent::info ( )
slot

◆ isCellValid

bool BITE::BiteAgent::isCellValid ( int  x,
int  y 
)
inlineslot

returns true, if a valid cell is at x/y

◆ item

BiteItem * BITE::BiteAgent::item ( QString  name)
slot

elements of the agent

◆ largeCellRUs()

const QVector< ResourceUnit * > & BITE::BiteAgent::largeCellRUs ( int  cellindex)
inline

◆ lifeCycle()

BiteLifeCycle * BITE::BiteAgent::lifeCycle ( ) const
inline

◆ name()

QString BITE::BiteAgent::name ( ) const
inline

(short) name of the agent

◆ notifyItems()

void BITE::BiteAgent::notifyItems ( BiteCell cell,
BiteCell::ENotification  what 
)

◆ onTreeRemovedFilter()

int BITE::BiteAgent::onTreeRemovedFilter ( ) const
inline

◆ run [1/2]

void BITE::BiteAgent::run ( )
slot

◆ run [2/2]

void BITE::BiteAgent::run ( BiteCellScript cell)
slot

◆ runOnTreeRemovedFilter()

void BITE::BiteAgent::runOnTreeRemovedFilter ( Tree tree,
int  reason 
)

◆ saveGrid

void BITE::BiteAgent::saveGrid ( QString  expression,
QString  file_name 
)
slot

evaluate 'expression' for each cell, update the internal drawing grid, and save the content to 'file_name'

◆ setCPPOwnership()

void BITE::BiteAgent::setCPPOwnership ( QObject *  obj)
static

helper function to set C++ ownership for 'obj'

◆ setLargeCellRuList()

void BITE::BiteAgent::setLargeCellRuList ( int  cellindex,
QVector< ResourceUnit * > &  list 
)

◆ setOnTreeRemovedFilter()

void BITE::BiteAgent::setOnTreeRemovedFilter ( int  value)

◆ setup()

void BITE::BiteAgent::setup ( QJSValue  obj)

setup of the agent with a data structure (provided via JS)

◆ setVerbose()

void BITE::BiteAgent::setVerbose ( bool  v)
inline

◆ stats()

BAgentStats & BITE::BiteAgent::stats ( )
inline

◆ threadSaplingList()

ABE::FMSaplingList * BITE::BiteAgent::threadSaplingList ( )
static

◆ threadTreeList()

ABE::FMTreeList * BITE::BiteAgent::threadTreeList ( )
static

◆ updateDrawGrid [1/2]

void BITE::BiteAgent::updateDrawGrid ( QJSValue  func)
slot

◆ updateDrawGrid [2/2]

void BITE::BiteAgent::updateDrawGrid ( QString  expression)
slot

evaluate 'expression' for each cell and update the internal drawing grid

◆ updateVariable [1/3]

void BITE::BiteAgent::updateVariable ( QString  var_name,
double  value 
)
slot

set the value of var_name to value for all cells

◆ updateVariable [2/3]

void BITE::BiteAgent::updateVariable ( QString  var_name,
QJSValue  func 
)
slot

set the value of var_name to the result of the javascript function func (evaluated with cell context)

◆ updateVariable [3/3]

void BITE::BiteAgent::updateVariable ( QString  var_name,
QString  expression 
)
slot

set the value of var_name to the result of 'expression' for all cells

◆ variables()

QStringList BITE::BiteAgent::variables ( )

◆ verbose()

bool BITE::BiteAgent::verbose ( ) const
inline

◆ width()

int BITE::BiteAgent::width ( ) const
inline

◆ wrapper()

BiteWrapperCore * BITE::BiteAgent::wrapper ( )
inline

Property Documentation

◆ cellSize

int BITE::BiteAgent::cellSize
read

◆ description

QString BITE::BiteAgent::description
read

◆ drawGrid

ScriptGrid* BITE::BiteAgent::drawGrid
read

◆ height

int BITE::BiteAgent::height
read

◆ name

QString BITE::BiteAgent::name
read

◆ onTreeRemovedFilter

int BITE::BiteAgent::onTreeRemovedFilter
readwrite

◆ variables

QStringList BITE::BiteAgent::variables
read

◆ verbose

bool BITE::BiteAgent::verbose
readwrite

◆ width

int BITE::BiteAgent::width
read

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