- void setConfig(std::string str);
-
- XBT_ATTRIB_DEPRECATED_v323("Please use Engine::load_platform()") void loadPlatform(const char* platf)
- {
- load_platform(platf);
- }
- XBT_ATTRIB_DEPRECATED_v323("Please use Engine::register_function()") void registerFunction(const char* name,
- int (*code)(int, char**))
- {
- register_function(name, code);
- }
- XBT_ATTRIB_DEPRECATED_v323("Please use Engine::register_default()") void registerDefault(int (*code)(int, char**))
- {
- register_default(code);
- }
- XBT_ATTRIB_DEPRECATED_v323("Please use Engine::load_deployment()") void loadDeployment(const char* deploy)
- {
- load_deployment(deploy);
- }
- XBT_ATTRIB_DEPRECATED_v323("Please use Engine::host_by_name()") simgrid::s4u::Host* hostByName(std::string name)
- {
- return host_by_name(name);
- }
- XBT_ATTRIB_DEPRECATED_v323("Please use Engine::host_by_name_or_null()") simgrid::s4u::Host* hostByNameOrNull(
- std::string name)
- {
- return host_by_name_or_null(name);
- }
- XBT_ATTRIB_DEPRECATED_v323("Please use Engine::storage_by_name()") simgrid::s4u::Storage* storageByName(
- std::string name)
- {
- return storage_by_name(name);
- }
- XBT_ATTRIB_DEPRECATED_v323("Please use Engine::storage_by_name_or_null()") simgrid::s4u::Storage* storageByNameOrNull(
- std::string name)
- {
- return storage_by_name_or_null(name);
- }
+ static void set_config(const std::string& str);
+ static void set_config(const std::string& name, int value);
+ static void set_config(const std::string& name, bool value);
+ static void set_config(const std::string& name, double value);
+ static void set_config(const std::string& name, const std::string& value);
+
+ Engine*
+ set_default_comm_data_copy_callback(const std::function<void(kernel::activity::CommImpl*, void*, size_t)>& callback);
+
+ /** Add a callback fired when the platform is created (ie, the xml file parsed),
+ * right before the actual simulation starts. */
+ static void on_platform_created_cb(const std::function<void()>& cb) { on_platform_created.connect(cb); }
+ /** Add a callback fired when the platform is about to be created
+ * (ie, after any configuration change and just before the resource creation) */
+ static void on_platform_creation_cb(const std::function<void()>& cb) { on_platform_creation.connect(cb); }
+ /** Add a callback fired when the main simulation loop starts, at the beginning of the first call to Engine::run() */
+ static void on_simulation_start_cb(const std::function<void()>& cb) { on_simulation_start.connect(cb); }
+ /** Add a callback fired when the main simulation loop ends, just before the end of Engine::run() */
+ static void on_simulation_end_cb(const std::function<void()>& cb) { on_simulation_end.connect(cb); }
+
+ /** Add a callback fired when the time jumps into the future.
+ *
+ * It is fired right after the time change (use get_clock() to get the new timestamp).
+ * The callback parameter is the time delta since previous timestamp. */
+ static void on_time_advance_cb(const std::function<void(double)>& cb) { on_time_advance.connect(cb); }