Rev 1008 | Rev 1033 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1008 | Rev 1010 | ||
---|---|---|---|
Line 8... | Line 8... | ||
8 | 8 | ||
9 | class BBGenerations
|
9 | class BBGenerations
|
10 | {
|
10 | {
|
11 | public: |
11 | public: |
12 | BBGenerations(); |
12 | BBGenerations(); |
- | 13 | /// calculate the number of barbeetle generations for the given resource unit.
|
|
13 | double calculateGenerations(const ResourceUnit *ru); |
14 | double calculateGenerations(const ResourceUnit *ru); |
- | 15 | ||
- | 16 | /// number of sister broods (reaching at least 60% of thermal development)
|
|
- | 17 | int sisterBroods() const { return mNSisterBroods; } |
|
- | 18 | /// number consecutive broods (reaching at least 60% of thermal development)
|
|
- | 19 | int filialBroods() const { return mNFilialBroods; } |
|
- | 20 | ||
- | 21 | /// returns true, if the sister broods of the same generation were also developed
|
|
- | 22 | /// (e.g. 2 gen + 2 sister -> true, 2 gen + 1 sister -> false)
|
|
- | 23 | bool hasSisterBrood() const { return mNSisterBroods == mNFilialBroods && mNSisterBroods>0; } |
|
- | 24 | ||
- | 25 | /// number of cold days (tmin < -15 degrees) in the first half of the year
|
|
- | 26 | int frostDaysEarly() const { return mFrostDaysEarly; } |
|
- | 27 | /// number of cold days (tmin < -15 degrees) in the second half of the year
|
|
- | 28 | int frostDaysLate() const { return mFrostDaysLate; } |
|
- | 29 | ||
14 | private: |
30 | private: |
15 | void calculateBarkTemperature(const ResourceUnit *ru); |
31 | void calculateBarkTemperature(const ResourceUnit *ru); |
16 | struct BBGeneration { |
32 | struct BBGeneration { |
17 | BBGeneration(): start_day(-1), gen(0), is_filial_generation(false), value(0.) {} |
- | |
18 | BBGeneration(int start, bool is_filial, int generation) { start_day=start; is_filial_generation=is_filial; value=0.; gen=generation; } |
- | |
- | 33 | BBGeneration(): start_day(-1), gen(0), is_sister_brood(false), value(0.) {} |
|
- | 34 | BBGeneration(int start, bool is_filial, int generation) { start_day=start; is_sister_brood=is_filial; value=0.; gen=generation; } |
|
19 | int start_day; |
35 | int start_day; |
20 | int gen; |
36 | int gen; |
21 | bool is_filial_generation; |
- | |
- | 37 | bool is_sister_brood; |
|
22 | double value; |
38 | double value; |
23 | }; |
39 | }; |
24 | QVector<BBGeneration> mGenerations; |
40 | QVector<BBGeneration> mGenerations; |
- | 41 | int mNSisterBroods; ///< number of sister broods (reaching at least 60% of thermal development) |
|
- | 42 | int mNFilialBroods; ///< number consecutive broods (reaching at least 60% of thermal development) |
|
- | 43 | int mFrostDaysEarly; ///< frost days (tmin<-15) from Jan 1 to summer |
|
- | 44 | int mFrostDaysLate; ///< frost days from summer to Dec 31 |
|
25 | 45 | ||
26 | double mEffectiveBarkTemp[366]; |
46 | double mEffectiveBarkTemp[366]; |
27 | }; |
47 | }; |
28 | 48 | ||
29 | #endif // BBGENERATIONS_H
|
49 | #endif // BBGENERATIONS_H
|