cpp/main.cpp

43 lines
1014 B
C++
Raw Normal View History

2024-08-18 11:21:27 +00:00
#include <iostream>
2024-08-16 17:55:27 +00:00
#include <unordered_map>
#include <random>
#include "io.h"
#include "sims.h"
#include "motions/base.h"
2024-09-16 17:52:51 +00:00
#include "motions/bimodalangle.h"
2024-08-23 16:33:38 +00:00
#include "motions/isosmallangle.h"
2024-08-16 17:55:27 +00:00
#include "motions/random.h"
2024-08-20 15:51:49 +00:00
#include "motions/tetrahedral.h"
2024-08-16 17:55:27 +00:00
#include "times/delta.h"
2024-09-16 17:52:51 +00:00
#include "times/lognormal.h"
2024-08-16 17:55:27 +00:00
2024-08-20 15:51:49 +00:00
int main (const int argc, char *argv[]) {
Arguments args;
try {
args = parse_args(argc, argv);
} catch (std::runtime_error& error) {
std::cerr << error.what() << std::endl;
2024-08-18 11:21:27 +00:00
return 1;
}
2024-08-20 15:51:49 +00:00
std::unordered_map parameter { read_parameter(args.parameter_file) };
2024-08-16 17:55:27 +00:00
std::random_device rd;
std::mt19937_64 rng(rd());
Motion *motion = Motion::createFromInput(args.motion_type, rng);
2024-09-16 17:52:51 +00:00
2024-11-04 17:09:25 +00:00
auto dist = DeltaDistribution(rng);
2024-11-04 18:39:53 +00:00
// auto dist = LogNormalDistribution(1, 2, rng); // arguments: tau_max, sigma
2024-08-16 17:55:27 +00:00
2024-08-20 15:51:49 +00:00
if (args.spectrum) {
run_spectrum(parameter, *motion, dist);
2024-08-20 15:51:49 +00:00
}
if (args.ste) {
run_ste(parameter, *motion, dist);
2024-08-20 15:51:49 +00:00
}
2024-08-16 17:55:27 +00:00
}