-
Notifications
You must be signed in to change notification settings - Fork 0
/
Data.cpp
191 lines (162 loc) · 3.02 KB
/
Data.cpp
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
#include "Data.h"
#include <fstream>
void Parameter::ReadFromFile(std::string StrPath)
{
std::ifstream fin(StrPath + "parameter.txt");
fin >> m_KC
>> m_UM
>> m_LM
>> m_C
>> m_WM
>> m_B
>> m_IM
>> m_SM
>> m_EX
>> m_KG
>> m_KI
>> m_CS
>> m_CI
>> m_CG
>> m_CR
>> m_KE
>> m_XE;
fin.close();
}
void Parameter::SetValues(double KC, double UM, double LM, double C,
double WM, double B, double IM,
double SM, double EX, double KG, double KI,
double CS, double CI, double CG, double CR, double KE, double XE)
{
m_KC = KC;
m_UM = UM;
m_LM = LM;
m_C = C;
m_WM = WM;
m_B = B;
m_IM = IM;
m_SM = SM;
m_EX = EX;
m_KG = KG;
m_KI = KI;
m_CS = CS;
m_CI = CI;
m_CG = CG;
m_CR = CR;
m_KE = KE;
m_XE = XE;
}
Parameter::Parameter(double KC, double UM, double LM, double C,
double WM, double B, double IM,
double SM, double EX, double KG, double KI,
double CS, double CI, double CG, double CR, double KE, double XE)
{
m_KC = KC;
m_UM = UM;
m_LM = LM;
m_C = C;
m_WM = WM;
m_B = B;
m_IM = IM;
m_SM = SM;
m_EX = EX;
m_KG = KG;
m_KI = KI;
m_CS = CS;
m_CI = CI;
m_CG = CG;
m_CR = CR;
m_KE = KE;
m_XE = XE;
}
Parameter::~Parameter()
{
}
void State::SetInput(int nt, int nw, Watershed* watershed)
{
m_P = watershed->GetP(nt, nw);
m_EM = watershed->GetEM(nt, nw);
m_F = watershed->GetF(nw);
}
void State::ReadFromFile(std::string StrPath)
{
std::ifstream fin(StrPath + "time.txt");
fin >> m_dt; //śÁČĄÄŁĐÍźĆËăĘąśÎł¤,h
fin.close();
}
void State::SetValues(double P, double EM, double F, double dt, double S0, double FR,
double EU, double EL, double ED, double E,
double WU, double WL, double WD, double W,
double RIM, double R, double RS, double RI, double RG,
double PE, double QS, double QI, double QG, double QU,
double QU0, double * O, double O2, double EP, double Q)
{
m_P = P;
m_EM = EM;
m_F = F;
m_dt = dt;
m_S0 = S0;
m_FR = FR;
m_EU = EU;
m_EL = EL;
m_ED = ED;
m_E = E;
m_WU = WU;
m_WL = WL;
m_WD = WD;
m_W = W;
m_RIM = RIM;
m_R = R;
m_RS = RS;
m_RI = RI;
m_RG = RG;
m_PE = PE;
m_QS = QS;
m_QI = QI;
m_QG = QG;
m_QU0 = QU0;
m_O = O;
m_O2 = O2;
m_EP = EP;
m_Q = Q;
}
State::State(double P, double EM, double F, double dt, double S0, double FR,
double EU, double EL, double ED, double E,
double WU, double WL, double WD, double W,
double RIM, double R, double RS, double RI, double RG,
double PE, double QS, double QI, double QG, double QU,
double QU0, double * O, double O2, double EP, double Q)
{
m_P = P;
m_EM = EM;
m_F = F;
m_dt = dt;
m_S0 = S0;
m_FR = FR;
m_EU = EU;
m_EL = EL;
m_ED = ED;
m_E = E;
m_WU = WU;
m_WL = WL;
m_WD = WD;
m_W = W;
m_RIM = RIM;
m_R = R;
m_RS = RS;
m_RI = RI;
m_RG = RG;
m_PE = PE;
m_QS = QS;
m_QI = QI;
m_QG = QG;
m_QU = QU;
m_QU0 = QU0;
m_O = O;
m_O2 = O2;
m_EP = EP;
m_Q = Q;
}
State::~State()
{
delete[] m_O;
}