24 #include <tclap/CmdLine.h> 31 using namespace TCLAP;
33 int main(
int argc,
char** argv) {
34 int exit_status = EXIT_SUCCESS;
39 CmdLine cmd(
"stride",
' ',
"2.0",
false);
40 ValueArg<string> config_file_Arg(
"c",
"config",
"Config File",
false,
42 ValueArg<unsigned int> timestamp_replay_Arg(
"t",
"timestamp",
"Replay from Timestamp",
false,
44 ValueArg<string> simulator_mode_Arg(
"m",
"mode",
"Simulator Mode (initial/extend/replay/extract)",
false,
45 "initial",
"mode", cmd);
46 ValueArg<string> hdf5_file_Arg(
"f",
"hdf5_file",
"HDF5 file (only used for mode 'extract')",
false,
48 MultiArg<string> overrides_Arg(
"o",
"override",
"Override the configuration",
false,
50 cmd.parse(argc, argv);
52 auto run_mode = SimulatorRunMode::getRunMode(simulator_mode_Arg.getValue());
54 cout <<
"All modes except 'extract' require a configuration file (-c flag)." << endl;
59 if (hdf5_file_Arg.getValue() ==
"") {
60 cout <<
"'extract' mode requires a file (-f flag)" << endl;
65 Hdf5Loader::extractConfigs(hdf5_file_Arg.getValue());
67 Runner runner(overrides_Arg.getValue(), config_file_Arg.getValue(), run_mode,
68 timestamp_replay_Arg.getValue());
70 runner.initSimulators();
73 }
catch (exception& e) {
74 exit_status = EXIT_FAILURE;
75 cerr << endl <<
"Exception: " << e.what() << endl;
77 exit_status = EXIT_FAILURE;
78 cerr << endl <<
"Unknown exception thrown." << endl;
Helper for parsing the config, and starting the simulators.
Time Dependent Person DataType.
int main(int argc, char **argv)