Rev 265 | Rev 278 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 265 | Rev 277 | ||
---|---|---|---|
Line 51... | Line 51... | ||
51 | 51 | ||
52 | /* be careful: setup() is called with a pointer somewhere to the content of the mRUSpecies container.
|
52 | /* be careful: setup() is called with a pointer somewhere to the content of the mRUSpecies container.
|
53 | If the container memory is relocated (QVector), the pointer gets invalid!!!
|
53 | If the container memory is relocated (QVector), the pointer gets invalid!!!
|
54 | Therefore, a resize() is called before the loop (no resize()-operations during the loop)! */
|
54 | Therefore, a resize() is called before the loop (no resize()-operations during the loop)! */
|
55 | mRUSpecies[i].setup(s,this); // setup this element |
55 | mRUSpecies[i].setup(s,this); // setup this element |
- | 56 | ||
56 | }
|
57 | }
|
57 | }
|
58 | }
|
58 | 59 | ||
59 | ResourceUnitSpecies &ResourceUnit::resourceUnitSpecies(const Species *species) |
60 | ResourceUnitSpecies &ResourceUnit::resourceUnitSpecies(const Species *species) |
60 | {
|
61 | {
|
Line 181... | Line 182... | ||
181 | void ResourceUnit::yearEnd() |
182 | void ResourceUnit::yearEnd() |
182 | {
|
183 | {
|
183 | // calculate statistics for all tree species of the ressource unit
|
184 | // calculate statistics for all tree species of the ressource unit
|
184 | int c = mRUSpecies.count(); |
185 | int c = mRUSpecies.count(); |
185 | for (int i=0;i<c; i++) { |
186 | for (int i=0;i<c; i++) { |
186 | mRUSpecies[i].statistics().calculate(); |
- | |
187 | mRUSpecies[i].statisticsDead().calculate(); |
- | |
- | 187 | mRUSpecies[i].statisticsDead().calculate(); // calculate the dead trees |
|
- | 188 | mRUSpecies[i].updateGWL(); // get sum od dead trees |
|
- | 189 | mRUSpecies[i].statistics().calculate(); // calculate the living (and add removed volume to gwl) |
|
188 | mStatistics.add(mRUSpecies[i].statistics()); |
190 | mStatistics.add(mRUSpecies[i].statistics()); |
189 | }
|
191 | }
|
190 | mStatistics.calculate(); // aggreagte on stand level |
192 | mStatistics.calculate(); // aggreagte on stand level |
191 | }
|
193 | }
|
192 | 194 |