-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTree.h
87 lines (71 loc) · 1.6 KB
/
Tree.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
//---------------------------------------------------------------------------
#ifndef TreeH
#define TreeH
#include <cmath>
#include <vector>
#include <map>
#include "Cell.h"
//---------------------------------------------------------------------------
class CSAR_Point
{
public:
double X;
double Y;
std::map<int,double> NNDistSpec; //nearest neighbour distance to each species
CSAR_Point(double x, double y)
{
X = x; Y = y;
NNDistSpec.clear();
};
~CSAR_Point()
{
NNDistSpec.clear();
};
};
//---------------------------------------------------------------------------
class CTree
{
public:
int TreeID;
double X;
double Y;
int SpecID;
double R; //ZOI Radius
double NCI; // neighbourhood crowding index
double pSurv; //Survival probability
std::list <CCell*> CellList; //list of grid cells overlapped by the tree
std::map<int,double> NNDistSpec; //nearest neighbour distance to each species
CTree(int id, double x, double y, int spec, double r)
{
TreeID = id;
X = x; Y = y;
SpecID = spec;
R = r;
//pSurv = p_surv;
NNDistSpec.clear();
};
~CTree()
{
CellList.clear();
NNDistSpec.clear();
};
/*
void GetPSurv(double a, double b)
{
if (A_zoi == 0.0) pSurv = b;
else pSurv = b - b*(A_comp/A_zoi)/(a + A_comp/A_zoi);
}
*/
/*
void GetPSurv2(double a, double b)
{
if (NCI == 0.0) pSurv = b;
else pSurv = b - b*(NCI)/(a + NCI);
}
*/
};
typedef std::vector<CTree*>::iterator TreeIterV;
typedef std::list<CTree*>::iterator TreeIterL;
typedef std::list<CSAR_Point*>::iterator PointIterL;
//---------------------------------------------------------------------------
#endif