-
Notifications
You must be signed in to change notification settings - Fork 0
/
DummyCompareSnowModel.h
55 lines (44 loc) · 1.71 KB
/
DummyCompareSnowModel.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
#ifndef DUMMY_COMPARE_SNOW_MODEL
#define DUMMY_COMPARE_SNOW_MODEL
#include "BackupSnowModel.h"
#include "DummyBalanceSnowModel.h"
#include <datastr/ConstantGeographicMap.h>
using namespace std;
namespace openworld {
class DummyCompareSnowModel : public DummyBalanceSnowModel {
protected:
BackupSnowModel& backup;
DividedRange backuptime;
int lastindex;
public:
DummyCompareSnowModel(BackupSnowModel& backup, GeographicMap<double>& initial, DividedRange backuptime)
: DummyBalanceSnowModel(initial, backup.getTimes()), backup(backup), backuptime(backuptime) {
this->lastindex = -1;
}
virtual SnowModel* clone() {
DummyCompareSnowModel* clone = new DummyCompareSnowModel(*((BackupSnowModel*) backup.clone()), volumes, backuptime);
clone->lastindex = lastindex;
return clone;
}
// returns the snowcover
virtual GeographicMap<double>& operator[](Measure tt) {
GeographicMap<double>& result = backup[tt];
/*
int index = backuptime.inRange(tt);
if (index >= 0 && index != lastindex) {
cout << "SNOW COMPARE," << tt << "," << index << endl;
for (unsigned rr = 0; rr < volumes.getLatitudes().count(); rr++)
for (unsigned cc = 0; cc < volumes.getLongitudes().count(); cc++) {
Measure latitude(Inds::lat), longitude(Inds::lon);
volumes.calcLatitudeLongitude(rr, cc, latitude, longitude);
if (result.validLocation(latitude, longitude))
cout << rr << "\t" << cc << "\t" << result.getDouble(latitude, longitude) << "\t" << volumes.getCellConst(rr, cc) << endl;
}
lastindex = backuptime.inRange(tt);
}
*/
return result;
}
};
}
#endif