iLand
modules.h
Go to the documentation of this file.
1/********************************************************************************************
2** iLand - an individual based forest landscape and disturbance model
3** http://iland-model.org
4** Copyright (C) 2009- Werner Rammer, Rupert Seidl
5**
6** This program is free software: you can redistribute it and/or modify
7** it under the terms of the GNU General Public License as published by
8** the Free Software Foundation, either version 3 of the License, or
9** (at your option) any later version.
10**
11** This program is distributed in the hope that it will be useful,
12** but WITHOUT ANY WARRANTY; without even the implied warranty of
13** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14** GNU General Public License for more details.
15**
16** You should have received a copy of the GNU General Public License
17** along with this program. If not, see <http://www.gnu.org/licenses/>.
18********************************************************************************************/
19
20#ifndef MODULES_H
21#define MODULES_H
22
23class DisturbanceInterface; // forward
24class SetupResourceUnitInterface; // forward
25class WaterInterface; // forward
26class TreeDeathInterface; // forward
27class ResourceUnit; // forward
28class Tree; // forward
29class WaterCycleData; // forward
30class QJSEngine; // forward
35{
36public:
37 Modules();
38
40 void setup();
42 DisturbanceInterface *module(const QString &module_name);
43
44 bool hasSetupResourceUnits() { return !mSetupRUs.isEmpty(); }
45 // setup of resource unit specific parameters
46 void setupResourceUnit(const ResourceUnit* ru);
47
48 // functions
49 void yearBegin();
50 void run();
51 // water
52 void calculateWater(const ResourceUnit *resource_unit, const WaterCycleData *water_data);
53
54 // tree death
55 void treeDeath(const Tree *tree, int removal_type);
56private:
57 void init();
58 QList<DisturbanceInterface*> mInterfaces;
59 QList<SetupResourceUnitInterface*> mSetupRUs;
60 QList<WaterInterface*> mWater;
61 QList<TreeDeathInterface*> mTreeDeath;
62};
63
64#endif // MODULES_H
Definition: plugin_interface.h:35
The Modules class is the container for iLand modules (e.g.
Definition: modules.h:35
void calculateWater(const ResourceUnit *resource_unit, const WaterCycleData *water_data)
Definition: modules.cpp:109
void setupResourceUnit(const ResourceUnit *ru)
Definition: modules.cpp:90
void yearBegin()
executes yearly initialization code for each module
Definition: modules.cpp:163
Modules()
Definition: modules.cpp:40
void setup()
general setup
Definition: modules.cpp:96
void run()
execute the modules
Definition: modules.cpp:125
DisturbanceInterface * module(const QString &module_name)
get interface by name (or 0 if not present)
Definition: modules.cpp:82
bool hasSetupResourceUnits()
Definition: modules.h:44
void treeDeath(const Tree *tree, int removal_type)
Definition: modules.cpp:115
ResourceUnit is the spatial unit that encapsulates a forest stand and links to several environmental ...
Definition: resourceunit.h:49
Definition: plugin_interface.h:52
Definition: plugin_interface.h:80
A tree is the basic simulation entity of iLand and represents a single tree.
Definition: tree.h:44
WaterCycleData is a data transfer container for water-related details.
Definition: watercycle.h:191
Definition: plugin_interface.h:67