summaryrefslogtreecommitdiff
path: root/pureMorse.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'pureMorse.cpp')
-rw-r--r--pureMorse.cpp56
1 files changed, 56 insertions, 0 deletions
diff --git a/pureMorse.cpp b/pureMorse.cpp
new file mode 100644
index 0000000..f157c35
--- /dev/null
+++ b/pureMorse.cpp
@@ -0,0 +1,56 @@
+#include <getopt.h>
+#include <chrono>
+
+#include "collectMorseData.hpp"
+
+#include "pcg-cpp/include/pcg_random.hpp"
+#include "randutils/randutils.hpp"
+
+using Rng = randutils::random_generator<pcg32>;
+
+int main(int argc, char* argv[]) {
+ // model parameters
+ unsigned N = 10; // number of spins
+ // simulation parameters
+ Real ε = 1e-15;
+ Real δz₀ = 1e-3;
+ unsigned n = 10;
+ bool useMinima = false;
+ bool useSpike = false;
+
+ int opt;
+
+ while ((opt = getopt(argc, argv, "N:e:d:n:ms")) != -1) {
+ switch (opt) {
+ case 'N':
+ N = (unsigned)atof(optarg);
+ break;
+ case 'e':
+ ε = atof(optarg);
+ break;
+ case 'd':
+ δz₀ = atof(optarg);
+ break;
+ case 'n':
+ n = atof(optarg);
+ break;
+ case 'm':
+ useMinima = true;
+ break;
+ case 's':
+ useSpike = true;
+ break;
+ default:
+ exit(1);
+ }
+ }
+
+ Rng r;
+
+ for (unsigned i = 0; i < n; i++) {
+ auto tag = std::chrono::high_resolution_clock::now();
+ collectMorseData<3>(std::to_string(tag.time_since_epoch().count()), N, r.engine(), ε, δz₀, useMinima, useSpike, 1.0);
+ }
+
+ return 0;
+}