iLand
Public Member Functions | Static Public Member Functions | Friends | List of all members
ABE::ForestManagementEngine Class Reference

the ForestManagementEngine is the container for the agent based forest management engine. More...

#include <forestmanagementengine.h>

Public Member Functions

 ForestManagementEngine ()
 
 ~ForestManagementEngine ()
 
void setup ()
 setup data structures More...
 
void initialize ()
 run initial stp More...
 
void clear ()
 delete all objects and free memory More...
 
void abortExecution (const QString &message)
 
bool isCancel () const
 
void runOnInit (bool before_init)
 run javascript code that can be used to initialize forest stands More...
 
void run (int debug_year=-1)
 this is the main function of the forest management engine. More...
 
void yearEnd ()
 write outputs, finalize the current year should be called at the end of the year (after all disturbances, ...) More...
 
int currentYear ()
 
bool enabled () const
 
void setEnabled (bool enable)
 
FomeScriptscriptBridge () const
 
void addSTP (FMSTP *stp)
 add a stand treatment programme to the list of programs. More...
 
void addAgentType (AgentType *at)
 add an agent type (called from JS) More...
 
void addAgent (Agent *agent)
 add an agent (called from JS) More...
 
AgentTypeagentType (const QString &name)
 return the agent type with the name 'name' or NULL More...
 
Agentagent (const QString &name)
 return the Agent with the name 'name' or NULL More...
 
FMSTPstp (QString stp_name) const
 retrieve pointer to stand treatment programme. return 0-pointer if not available. More...
 
FMStandstand (int stand_id) const
 get stand with id 'stand_id'. Return 0 if not found. More...
 
const QMultiMap< FMUnit *, FMStand * > & stands () const
 
const QVector< FMUnit * > & units () const
 
QVariantList standIds () const
 
FMStandstandAt (QPointF coord) const
 
void notifyTreeRemoval (Tree *tree, int reason)
 called by iLand for every tree that is removed/harvested/died due to disturbance. More...
 
bool notifyBarkbeetleAttack (const ResourceUnit *ru, const double generations, int n_infested_px)
 called when bark beetle are likely going to spread More...
 
FMStandsplitExistingStand (FMStand *stand)
 
void test ()
 evalaute forest management activities and select fitting activities for each forest stand More...
 
QStringList evaluateClick (const QPointF coord, const QString &grid_name)
 

Static Public Member Functions

static ForestManagementEngineinstance ()
 
static const MapGridstandGrid ()
 link to stand grid More...
 
static QJSEngine * scriptEngine ()
 access to the "global" Javascript engine More...
 

Friends

class UnitOut
 

Detailed Description

the ForestManagementEngine is the container for the agent based forest management engine.

Constructor & Destructor Documentation

◆ ForestManagementEngine()

ABE::ForestManagementEngine::ForestManagementEngine ( )

◆ ~ForestManagementEngine()

ABE::ForestManagementEngine::~ForestManagementEngine ( )

Member Function Documentation

◆ abortExecution()

void ABE::ForestManagementEngine::abortExecution ( const QString &  message)

◆ addAgent()

void ABE::ForestManagementEngine::addAgent ( Agent agent)
inline

add an agent (called from JS)

◆ addAgentType()

void ABE::ForestManagementEngine::addAgentType ( AgentType at)
inline

add an agent type (called from JS)

◆ addSTP()

void ABE::ForestManagementEngine::addSTP ( FMSTP stp)
inline

add a stand treatment programme to the list of programs.

◆ agent()

Agent * ABE::ForestManagementEngine::agent ( const QString &  name)

return the Agent with the name 'name' or NULL

◆ agentType()

AgentType * ABE::ForestManagementEngine::agentType ( const QString &  name)

return the agent type with the name 'name' or NULL

◆ clear()

void ABE::ForestManagementEngine::clear ( )

delete all objects and free memory

◆ currentYear()

int ABE::ForestManagementEngine::currentYear ( )
inline

◆ enabled()

bool ABE::ForestManagementEngine::enabled ( ) const
inline

◆ evaluateClick()

QStringList ABE::ForestManagementEngine::evaluateClick ( const QPointF  coord,
const QString &  grid_name 
)

◆ initialize()

void ABE::ForestManagementEngine::initialize ( )

run initial stp

◆ instance()

static ForestManagementEngine * ABE::ForestManagementEngine::instance ( )
inlinestatic

◆ isCancel()

bool ABE::ForestManagementEngine::isCancel ( ) const
inline

◆ notifyBarkbeetleAttack()

bool ABE::ForestManagementEngine::notifyBarkbeetleAttack ( const ResourceUnit ru,
const double  generations,
int  n_infested_px 
)

called when bark beetle are likely going to spread

◆ notifyTreeRemoval()

void ABE::ForestManagementEngine::notifyTreeRemoval ( Tree tree,
int  reason 
)

called by iLand for every tree that is removed/harvested/died due to disturbance.

◆ run()

void ABE::ForestManagementEngine::run ( int  debug_year = -1)

this is the main function of the forest management engine.

the function is called every year.

◆ runOnInit()

void ABE::ForestManagementEngine::runOnInit ( bool  before_init)

run javascript code that can be used to initialize forest stands

◆ scriptBridge()

FomeScript * ABE::ForestManagementEngine::scriptBridge ( ) const
inline

◆ scriptEngine()

QJSEngine * ABE::ForestManagementEngine::scriptEngine ( )
static

access to the "global" Javascript engine

◆ setEnabled()

void ABE::ForestManagementEngine::setEnabled ( bool  enable)
inline

◆ setup()

void ABE::ForestManagementEngine::setup ( )

setup data structures

◆ splitExistingStand()

FMStand * ABE::ForestManagementEngine::splitExistingStand ( FMStand stand)

◆ stand()

FMStand * ABE::ForestManagementEngine::stand ( int  stand_id) const

get stand with id 'stand_id'. Return 0 if not found.

◆ standAt()

FMStand * ABE::ForestManagementEngine::standAt ( QPointF  coord) const
inline

◆ standGrid()

const MapGrid * ABE::ForestManagementEngine::standGrid ( )
static

link to stand grid

◆ standIds()

QVariantList ABE::ForestManagementEngine::standIds ( ) const

◆ stands()

const QMultiMap< FMUnit *, FMStand * > & ABE::ForestManagementEngine::stands ( ) const
inline

◆ stp()

FMSTP * ABE::ForestManagementEngine::stp ( QString  stp_name) const

retrieve pointer to stand treatment programme. return 0-pointer if not available.

◆ test()

void ABE::ForestManagementEngine::test ( )

evalaute forest management activities and select fitting activities for each forest stand

◆ units()

const QVector< FMUnit * > & ABE::ForestManagementEngine::units ( ) const
inline

◆ yearEnd()

void ABE::ForestManagementEngine::yearEnd ( )

write outputs, finalize the current year should be called at the end of the year (after all disturbances, ...)

Friends And Related Function Documentation

◆ UnitOut

friend class UnitOut
friend

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