iLand
bitelifecycle.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 BITELIFECYCLE_H
20#define BITELIFECYCLE_H
21
22#include "biteitem.h"
23#include "bitecellscript.h"
24
25namespace BITE {
26
28{
29 Q_OBJECT
30
31public:
32 Q_INVOKABLE BiteLifeCycle(QJSValue obj);
33
34 void setup(BiteAgent *parent_agent);
35 QString info();
36 void notify(BiteCell *cell, BiteCell::ENotification what);
37 void run();
38
39
40 bool dieAfterDispersal() const { return mDieAfterDispersal; }
41
44
46 bool shouldSpread(BiteCell *cell);
47
50 int outbreakYears() { return mOutbreakYears; }
51
52protected:
53 QStringList allowedProperties();
54private:
55 void calcOutbreakWaves();
56 DynamicExpression mSpreadFilter;
57 DynamicExpression mVoltinism;
58 DynamicExpression mSpreadInterval;
59 DynamicExpression mMortality;
60 int mSpreadDelay;
61 bool mDieAfterDispersal;
62
63 // outbreak waves
64 DynamicExpression mOutbreakDuration;
65 DynamicExpression mOutbreakStart;
66 int mOutbreakYears; // number of years in an outbreak
67 int mThisOutbreakDuration;
68 int mNextOutbreakStart;
69
70 Events mEvents;
71
72};
73
74} // end namespace
75#endif // BITELIFECYCLE_H
Definition: biteagent.h:71
Definition: bitecell.h:38
ENotification
Definition: bitecell.h:71
Definition: biteitem.h:37
Definition: bitelifecycle.h:28
int numberAnnualCycles(BiteCell *cell)
fetch the number of cycles the agent should run for the cell
Definition: bitelifecycle.cpp:125
QString info()
Definition: bitelifecycle.cpp:85
bool dieAfterDispersal() const
Definition: bitelifecycle.h:40
bool shouldSpread(BiteCell *cell)
should the cell be an active spreader in the next iteration?
Definition: bitelifecycle.cpp:132
void notify(BiteCell *cell, BiteCell::ENotification what)
Definition: bitelifecycle.cpp:92
QStringList allowedProperties()
Definition: bitelifecycle.cpp:161
int outbreakYears()
number of years that an outbreak wave is currently active the value is 0 for non-outbreak years
Definition: bitelifecycle.h:50
void setup(BiteAgent *parent_agent)
Definition: bitelifecycle.cpp:31
Q_INVOKABLE BiteLifeCycle(QJSValue obj)
Definition: bitelifecycle.cpp:26
void run()
Definition: bitelifecycle.cpp:100
Definition: bitecellscript.h:88
Definition: biteagent.cpp:32
DynamicExpression encapsulates an "expression" that can be either a iLand expression,...
Definition: bitecellscript.h:111