86 for (
int i = 0; i < nbSteps; i++)
112 }
else if (format ==
'h') {
114 }
else if (format ==
'm') {
116 }
else if (format ==
's') {
119 throw std::invalid_argument(
"received invalid format ['d': day, 'h': hours, 'm': minutes, 's': seconds]");
157 std::ostringstream os;
Defines the Scenario class for managing the simulation scenario.
size_t getNbUpdates() const
get the number of update since the creation of the world
Manages the simulation scenario.
World & getWorld()
Gets the world of the scenario.
void init(nlohmann::json config)
Initializes the scenario with a configuration.
void loop()
Runs the main loop of the scenario.
void showBenchmarksSummaries() const
std::string getBenchmarksJSON() const
vector< PrimoCell< CellBody > * > * _getCells()
Gets the cells in the simulation.
MecaCell::Config::random_engine_t local_random_engine
int getCurrentStep()
Gets the current number of time steps.
string _getBenchmarksJSON() const
CellPlugin< PrimoCell< CellBody > > * plugins
Cell plugins.
int getSeed() const
Gets the seed used for random number generation.
void update(int nbSteps)
Updates the simulation by multiple time steps.
Simu(string params, int _seed, bool benchmark)
void setStaticVariables()
void showBenchmarksSummaries() const
prints the benchmark summaries.
double getTime(char format)
Gets the elapsed time in a given format.
void update()
Updates the simulation by one time step.
a class to store JSON values
static JSON_NODISCARD basic_json parse(detail::input_adapter &&i, const parser_callback_t cb=nullptr, const bool allow_exceptions=true)
deserialize from a compatible input
A simple vector class template.
static void initRandomSeed(int seed=clock())
Initializes the random seed.
Provides common mathematical functions and vector operations.
static void setCurrentEngine(random_engine_t *eng)
std::mt19937 random_engine_t
static random_engine_t & globalRand()
access to the static global random engine.This pseudo - random generator is* used in random 3D vector...