iLand
actplanting.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#ifndef ACTPLANTING_H
20#define ACTPLANTING_H
21
22#include "activity.h"
23#include "species.h"
24
25class ResourceUnitSpecies; // forward
26
27namespace ABE {
28
29class FMSTP; // forward
30class FMStand; // forward
31
32class ActPlanting : public Activity
33{
34public:
35 ActPlanting(FMSTP *parent);
36 QString type() const { return "planting"; }
37 void setup(QJSValue value);
38 bool execute(FMStand *stand);
39 //bool evaluate(FMStand *stand);
40 QStringList info();
41
42 // run an one-time planting item
43 static void runSinglePlantingItem(FMStand *stand, QJSValue value);
44private:
45 struct SPlantingItem {
46 SPlantingItem(): species(0), fraction(0.), height(0.05), age(1), clear(false), grouped(false), group_type(-1), n(0), offset(0), spacing(0) {}
47 Species *species;
48 QJSValue fraction;
49 double height;
50 int age;
51 bool clear;
52 bool grouped;
53 int group_type;
54 QJSValue n;
55 int offset;
56 QJSValue spacing;
57 bool random;
58 bool setup(QJSValue value);
59 void run(FMStand *stand);
60 };
61 QVector<SPlantingItem> mItems;
62 bool mRequireLoading;
63
64 static QStringList mAllowedProperties;
65
66
67};
68
69} // end namespace
70#endif // ACTPLANTING_H
The ActPlanting class implements artificial regeneration (i.e., planting of trees).
Definition: actplanting.h:33
static void runSinglePlantingItem(FMStand *stand, QJSValue value)
Definition: actplanting.cpp:209
bool execute(FMStand *stand)
executes the action (usually defined in derived classes) using the context of 'stand'.
Definition: actplanting.cpp:174
void setup(QJSValue value)
setup of the activity (events, schedule, constraints). additional setup in derived classes.
Definition: actplanting.cpp:136
QString type() const
Definition: actplanting.h:36
ActPlanting(FMSTP *parent)
Definition: actplanting.cpp:125
QStringList info()
dumps some information for debugging
Definition: actplanting.cpp:191
Activity is the base class for management activities.
Definition: activity.h:162
friend class FMStand
Definition: activity.h:218
The FMSTP class encapsulates a stand treatment program, which is defined in Javascript.
Definition: fmstp.h:39
FMStand encapsulates a forest stand for the forest management engine.
Definition: fmstand.h:49
The class contains data available at ResourceUnit x Species scale.
Definition: resourceunitspecies.h:34
The behavior and general properties of tree species.
Definition: species.h:75
Definition: abegrid.h:22