iLand
bitedispersal.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 BITEDISPERSAL_H
20#define BITEDISPERSAL_H
21
22#include "biteitem.h"
23#include "grid.h"
24#include "scriptgrid.h"
25#include "bitecellscript.h"
26
27
28namespace BITE {
29
31{
32 Q_OBJECT
33 Q_PROPERTY(ScriptGrid* grid READ grid)
34
35public:
36 //BiteDispersal();
37 Q_INVOKABLE BiteDispersal(QJSValue obj);
38 void setup(BiteAgent *parent_agent);
39 ScriptGrid *grid() { Q_ASSERT(mScriptGrid != nullptr); return mScriptGrid; }
40
41 QString info();
42
43public slots:
44 // actions
45 void run();
46 void decide();
47protected:
48 QStringList allowedProperties();
49private:
51 void setupKernel(QString expr, double max_dist, QString dbg_file);
53 void spreadKernel();
55 void prepareGrid();
56 Grid<double> mKernel;
57 int mKernelOffset;
58 Grid<double> mGrid;
59 ScriptGrid *mScriptGrid;
60 Events mEvents;
61
62};
63
65{
66 Q_OBJECT
67 Q_PROPERTY(ScriptGrid* grid READ grid)
68
69public:
70 Q_INVOKABLE BiteDistribution(QJSValue obj);
71 void setup(BiteAgent *parent_agent);
72 ScriptGrid *grid() { Q_ASSERT(mScriptGrid != nullptr); return mScriptGrid; }
73 QString info();
74
75
76public slots:
77 void run();
78protected:
79 QStringList allowedProperties();
80private:
81 Grid<double> mGrid;
82 ScriptGrid *mScriptGrid;
83
84
85 Events mEvents;
86
87};
88
89
90} // end namespace
91#endif // BITEDISPERSAL_H
Definition: biteagent.h:71
Definition: bitedispersal.h:31
void decide()
Definition: bitedispersal.cpp:106
void run()
Definition: bitedispersal.cpp:92
ScriptGrid * grid
Definition: bitedispersal.h:33
ScriptGrid * grid()
Definition: bitedispersal.h:39
QStringList allowedProperties()
Definition: bitedispersal.cpp:121
void setup(BiteAgent *parent_agent)
Definition: bitedispersal.cpp:40
QString info()
Definition: bitedispersal.cpp:86
Q_INVOKABLE BiteDispersal(QJSValue obj)
Definition: bitedispersal.cpp:35
Definition: bitedispersal.h:65
ScriptGrid * grid()
Definition: bitedispersal.h:72
ScriptGrid * grid
Definition: bitedispersal.h:67
QStringList allowedProperties()
Definition: bitedispersal.cpp:285
void setup(BiteAgent *parent_agent)
Definition: bitedispersal.cpp:228
void run()
Definition: bitedispersal.cpp:279
Q_INVOKABLE BiteDistribution(QJSValue obj)
Definition: bitedispersal.cpp:223
QString info()
Definition: bitedispersal.cpp:272
Definition: biteitem.h:37
Definition: bitecellscript.h:88
Grid class (template).
Definition: grid.h:44
Definition: scriptgrid.h:29
Definition: biteagent.cpp:32