/
main.cpp
67 lines (58 loc) · 1.71 KB
/
main.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
// Copyright 2020 Joren Brunekreef and Andrzej Görlich
#include "config.hpp"
#include "pool.hpp"
#include "bag.hpp"
#include "vertex.hpp"
#include "triangle.hpp"
#include "universe.hpp"
#include "simulation.hpp"
#include "observable.hpp"
#include "observables/volume_profile.hpp"
#include "observables/hausdorff.hpp"
#include "observables/hausdorff_dual.hpp"
#include "observables/ricci.hpp"
#include "observables/ricci_dual.hpp"
#include "observables/riccih.hpp"
#include "observables/ricciv.hpp"
int main(int argc, const char * argv[]) {
std::string fname;
if (argc > 1) {
fname = std::string(argv[1]);
printf("%s\n", fname.c_str());
}
ConfigReader cfr;
cfr.read(fname);
double lambda = cfr.getDouble("lambda");
int targetVolume = cfr.getInt("targetVolume");
int slices = cfr.getInt("slices");
std::string sphereString = cfr.getString("sphere");
if (sphereString == "true") {
Universe::sphere = true;
printf("sphere\n");
}
int seed = cfr.getInt("seed");
std::string fID = cfr.getString("fileID");
int measurements = cfr.getInt("measurements");
std::string impGeomString = cfr.getString("importGeom");
bool impGeom = false;
if (impGeomString == "true") impGeom = true;
if (impGeom) {
std::string geomFn = Universe::getGeometryFilename(targetVolume, slices, seed);
if (geomFn != "") {
Universe::importGeometry(geomFn);
} else {
printf("No suitable geometry file found. Creating new Universe...\n");
}
}
if (Universe::imported == false) {
Universe::create(slices);
}
VolumeProfile vp(fID);
Simulation::addObservable(vp);
Hausdorff haus(fID);
Simulation::addObservable(haus);
printf("seed: %d\n", seed);
Simulation::start(measurements, lambda, targetVolume, seed);
printf("end\n");
return 0;
}