iLand
bbgenerations.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 BBGENERATIONS_H
21#define BBGENERATIONS_H
22
23#include <QVector>
24
25class ResourceUnit; // forward
26
28{
29public:
32 double calculateGenerations(const ResourceUnit *ru);
33
35 int sisterBroods() const { return mNSisterBroods; }
37 int filialBroods() const { return mNFilialBroods; }
38
41 bool hasSisterBrood() const { return mNSisterBroods == mNFilialBroods && mNSisterBroods>0; }
42
44 int frostDaysEarly() const { return mFrostDaysEarly; }
46 int frostDaysLate() const { return mFrostDaysLate; }
47
48private:
49 void calculateBarkTemperature(const ResourceUnit *ru);
50 struct BBGeneration {
51 BBGeneration(): start_day(-1), gen(0), is_sister_brood(false), value(0.) {}
52 BBGeneration(int start, bool is_sister, int generation) { start_day=start; is_sister_brood=is_sister; value=0.; gen=generation; }
53 int start_day;
54 int gen;
55 bool is_sister_brood;
56 double value;
57 };
58 QVector<BBGeneration> mGenerations;
59 int mNSisterBroods;
60 int mNFilialBroods;
61 int mFrostDaysEarly;
62 int mFrostDaysLate;
63
64 double mEffectiveBarkTemp[366];
65};
66
67#endif // BBGENERATIONS_H
BBGenerations calculates potential bark beetle generations based on climate data (including bark temp...
Definition: bbgenerations.h:28
int frostDaysLate() const
number of cold days (tmin < -15 degrees) in the second half of the year
Definition: bbgenerations.h:46
double calculateGenerations(const ResourceUnit *ru)
calculate the number of barbeetle generations for the given resource unit.
Definition: bbgenerations.cpp:37
bool hasSisterBrood() const
returns true, if the sister broods of the same generation were also developed (e.g.
Definition: bbgenerations.h:41
int sisterBroods() const
number of sister broods (reaching at least 60% of thermal development)
Definition: bbgenerations.h:35
int frostDaysEarly() const
number of cold days (tmin < -15 degrees) in the first half of the year
Definition: bbgenerations.h:44
BBGenerations()
Definition: bbgenerations.cpp:28
int filialBroods() const
number consecutive broods (reaching at least 60% of thermal development)
Definition: bbgenerations.h:37
ResourceUnit is the spatial unit that encapsulates a forest stand and links to several environmental ...
Definition: resourceunit.h:49