return SIMIX_get_clock();
}
+void Engine::add_model(std::shared_ptr<kernel::resource::Model> model,
+ const std::vector<kernel::resource::Model*>& dependencies)
+{
+ simgrid::kernel::actor::simcall([this, &model, &dependencies] { pimpl->add_model(std::move(model), dependencies); });
+}
+
+const std::vector<simgrid::kernel::resource::Model*>& Engine::get_all_models() const
+{
+ return pimpl->get_all_models();
+}
+
/**
* Creates a new platform, including hosts, links, and the routing table.
*
- * \rst
+ * @beginrst
* See also: :ref:`platform`.
- * \endrst
+ * @endrst
*/
void Engine::load_platform(const std::string& platf) const
{
/** Load a deployment file and launch the actors that it contains
*
- * \rst
+ * @beginrst
* See also: :ref:`deploy`.
- * \endrst
+ * @endrst
*/
void Engine::load_deployment(const std::string& deploy) const
{
/** @brief Retrieve the root netzone, containing all others */
s4u::NetZone* Engine::get_netzone_root() const
{
- return pimpl->netzone_root_->get_iface();
+ if (pimpl->netzone_root_)
+ return pimpl->netzone_root_->get_iface();
+ return nullptr;
}
/** @brief Set the root netzone, containing all others. Once set, it cannot be changed. */
void Engine::set_netzone_root(const s4u::NetZone* netzone)
return netp == pimpl->netpoints_.end() ? nullptr : netp->second;
}
+kernel::routing::NetPoint* Engine::netpoint_by_name(const std::string& name) const
+{
+ auto netp = netpoint_by_name_or_null(name);
+ if (netp == nullptr) {
+ throw std::invalid_argument(std::string("Netpoint not found: %s") + name);
+ }
+ return netp;
+}
+
std::vector<kernel::routing::NetPoint*> Engine::get_all_netpoints() const
{
std::vector<kernel::routing::NetPoint*> res;