Rev 1221 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1033 | werner | 1 | /******************************************************************************************** |
2 | ** iLand - an individual based forest landscape and disturbance model |
||
3 | ** http://iland.boku.ac.at |
||
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 | ********************************************************************************************/ |
||
931 | werner | 19 | #include "abestandremovalout.h" |
20 | #include "globalsettings.h" |
||
21 | |||
22 | #include "forestmanagementengine.h" |
||
23 | #include "fmstand.h" |
||
24 | #include "fmunit.h" |
||
25 | #include "scheduler.h" |
||
26 | |||
27 | namespace ABE { |
||
28 | |||
29 | ABEStandRemovalOut::ABEStandRemovalOut() |
||
30 | { |
||
31 | setName("Annual harvests on stand level.", "abeStandRemoval"); |
||
32 | setDescription("This output provides details about realized timber harvests on stand level. " \ |
||
1157 | werner | 33 | "The timber is provided as standing timber per hectare. The total harvest on the stand is the sum of thinning and final."); |
931 | werner | 34 | columns() << OutputColumn::year() |
35 | << OutputColumn("unitid", "unique identifier of the planning unit", OutString) |
||
36 | << OutputColumn("standid", "unique identifier of the forest stand", OutInteger) |
||
37 | << OutputColumn("area", "total area of the forest stand (ha)", OutDouble) |
||
953 | werner | 38 | << OutputColumn("age", "absolute stand age at the time of the activity (yrs)", OutDouble) |
931 | werner | 39 | << OutputColumn("activity", "name of the management activity that is executed", OutString) |
40 | << OutputColumn("volumeAfter", "standing timber volume after the harvest operation (m3/ha)", OutDouble) |
||
41 | << OutputColumn("volumeThinning", "removed timber volume due to thinning, m3/ha", OutDouble) |
||
42 | << OutputColumn("volumeFinal", "removed timber volume due to final harvests (regeneration cuts) and due to salvage operations, m3/ha", OutDouble) |
||
1157 | werner | 43 | << OutputColumn("volumeDisturbed", "disturbed trees on the stand, m3/ha. Note: all killed trees are recorded here,also those trees that are not salvaged (due to size and other constraints)", OutDouble); |
931 | werner | 44 | } |
45 | |||
46 | void ABEStandRemovalOut::exec() |
||
47 | { |
||
48 | foreach(const FMStand *stand, ForestManagementEngine::instance()->stands()) { |
||
49 | if (stand->totalHarvest()>0.) { |
||
50 | *this << currentYear(); |
||
953 | werner | 51 | *this << stand->unit()->id() << stand->id() << stand->area() << stand->lastExecutionAge(); |
931 | werner | 52 | *this << (stand->lastExecutedActivity()?stand->lastExecutedActivity()->name():QString()); |
53 | *this << qRound(stand->volume()*100.)/100. << stand->totalThinningHarvest() / stand->area() // thinning alone |
||
54 | << (stand->totalHarvest() - stand->totalThinningHarvest() ) / stand->area() // final harvests (including salvage operations) |
||
55 | << stand->disturbedTimber() / stand->area(); // disturbed trees on the stand |
||
56 | |||
57 | writeRow(); |
||
58 | } |
||
59 | } |
||
60 | } |
||
61 | |||
62 | void ABEStandRemovalOut::setup() |
||
63 | { |
||
64 | |||
65 | } |
||
66 | |||
67 | |||
68 | |||
69 | |||
70 | } // namespace |