Subversion Repositories public iLand

Rev

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
********************************************************************************************/
905 werner 19
#ifndef ACTSALVAGE_H
20
#define ACTSALVAGE_H
21
 
22
#include "activity.h"
914 werner 23
#include "grid.h"
905 werner 24
class Expression; // forward
25
class Tree; // forward
907 werner 26
namespace ABE {
905 werner 27
 
28
class FMSTP; // forward
29
class FMStand; // forward
30
 
31
class ActSalvage : public Activity
32
{
33
public:
34
    ActSalvage(FMSTP *parent);
35
    ~ActSalvage();
36
    QString type() const { return "salvage"; }
37
    void setup(QJSValue value);
38
    bool execute(FMStand *stand);
39
    QStringList info();
40
    // special functions of salvage activity
41
 
42
    /// return true, if the (disturbed) tree should be harvested by the salvage activity
911 werner 43
    bool evaluateRemove(Tree* tree) const;
1070 werner 44
    bool barkbeetleAttack(FMStand *stand, double generations, int infested_px_ha);
905 werner 45
private:
914 werner 46
    void checkStandAfterDisturbance(FMStand *stand);
1157 werner 47
    int floodFillHelper(Grid<int> &grid, QPoint start, int old_color, int color);
48
    int neighborFinderHelper(Grid<int> &grid, QVector<int> &neighbors, int stand_id);
49
    int replaceValueHelper(Grid<int> &grid, int old_value, int new_value);
914 werner 50
    bool mDebugSplit;
905 werner 51
    Expression *mCondition; ///< formula to determine which trees should be harvested
52
    int mMaxPreponeActivity; ///< no of years that a already scheduled (regular) activity is 'preponed'
1157 werner 53
    double mThresholdMinimal; ///< lower threshold (below no action is taken) in m3/ha
54
    double mThresholdSplit; ///<threshold (relative damage, 0..1) when a split of the stand should be initiated
55
    double mThresholdClear; ///<threshold (relative damage, 0..1) when a stand should be completely cleared
905 werner 56
 
1088 werner 57
 
905 werner 58
};
59
 
60
 
61
} // namespace
62
#endif // ACTSALVAGE_H