From 1366598409c694f0d3b41512fc8f31c5c0e623de Mon Sep 17 00:00:00 2001 From: Joshua Coles Date: Wed, 1 Mar 2023 21:22:55 +0000 Subject: [PATCH] Allow config of parameters from commandline. --- mainDLA.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/mainDLA.cpp b/mainDLA.cpp index 2171f4a..0e427be 100644 --- a/mainDLA.cpp +++ b/mainDLA.cpp @@ -3,13 +3,18 @@ #include "DLASystem.h" int main(int argc, char **argv) { - // create the system - auto *sys = new DLASystem(1000, std::string("./out.csv")); - - // this is the seed for the random numbers - int seed = 6; + if (argc != 4) { + cerr << "Usage " << argv[0] << " " << endl; + return 1; + } + int seed = std::stoi(argv[1]); + int maxParticles = std::stoi(argv[2]); + string csvPath = argv[3]; std::cerr << "Setting seed " << seed << endl; + + // create the system + auto *sys = new DLASystem(maxParticles, csvPath); sys->setSeed(seed); sys->running = true;