37class CommandLineArgs {
50 std::vector<Argument> mArguments;
53 CommandLineArgs(
int argc,
char *argv[],
55 String name =
"dpsim", Real dt = 0.001, Real d = 1,
56 Real sf = 50, Int s = -1,
57 CPS::Logger::Level ll = CPS::Logger::Level::info,
58 CPS::Logger::Level clill = CPS::Logger::Level::off,
59 Bool ss =
false, Bool b =
false, Bool si =
false,
60 CPS::Domain sd = CPS::Domain::DP,
62 DirectLinearSolverImpl mi = DirectLinearSolverImpl::KLU,
63 String spn =
"plugin.so", String params =
"default.json");
66 String name =
"dpsim", Real dt = 0.001, Real d = 1, Real sf = 50,
67 Int s = -1, CPS::Logger::Level ll = CPS::Logger::Level::info,
68 CPS::Logger::Level clill = CPS::Logger::Level::off, Bool ss =
false,
69 Bool b =
false, Bool si =
false, CPS::Domain sd = CPS::Domain::DP,
71 DirectLinearSolverImpl mi = DirectLinearSolverImpl::KLU,
72 String spn =
"plugin.so");
74 void parseArguments(
int argc,
char *argv[]);
82 CPS::Logger::Level logLevel;
83 CPS::Logger::Level cliLogLevel;
95 DPsim::DirectLinearSolverImpl directImpl;
96 String solverPluginName;
98 DPsim::Timer::StartClock::time_point startTime;
100 std::list<String> positional;
101 std::list<fs::path> positionalPaths()
const;
103 std::map<String, String> options;
105 Int getOptionInt(String optionName) {
108 return std::stoi(options[optionName]);
114 Real getOptionReal(String optionName) {
117 return std::stod(options[optionName]);
119 throw CPS::TypeException();
123 Bool getOptionBool(String optionName) {
125 if (options[optionName] ==
"true")
127 else if (options[optionName] ==
"false")
130 throw CPS::TypeException();
133 String getOptionString(String optionName) {
return options[optionName]; }
139void applySimulationParametersFromJson(
const json config, Simulation &sim);
157 unmangled = abi::__cxa_demangle(mangled, NULL, NULL, &status);