cpp/main.cpp
2024-11-11 14:07:21 +01:00

48 lines
1013 B
C++

#include "utils/io.h"
#include "simulation/sims.h"
#include "motions/base.h"
#include "times/delta.h"
#include "times/lognormal.h"
#include <iostream>
#include <unordered_map>
#include <random>
int main (const int argc, char *argv[]) {
Arguments args;
try {
args = parse_args(argc, argv);
} catch (std::invalid_argument& error) {
std::cerr << error.what() << std::endl;
return 1;
}
std::unordered_map parameter { read_parameter(args.parameter_file) };
for (const auto& [key, value]: args.optional) {
parameter[key] = value;
}
std::random_device rd;
std::mt19937_64 rng(rd());
Motion *motion = Motion::createFromInput(args.motion_type, rng);
auto dist = DeltaDistribution(rng);
// auto dist = LogNormalDistribution(1, 2, rng); // arguments: tau_max, sigma
if (args.spectrum) {
run_spectrum(parameter, *motion, dist);
}
if (args.ste) {
run_ste(parameter, *motion, dist);
}
return 0;
}