Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
have each model register into all_existing_models by itself
[simgrid.git] / src / surf / network_constant.cpp
index c1f0970..0ebd181 100644 (file)
@@ -16,14 +16,18 @@ void surf_network_model_init_Constant()
 {
   xbt_assert(surf_network_model == nullptr);
   surf_network_model = new simgrid::kernel::resource::NetworkConstantModel();
-  all_existing_models->push_back(surf_network_model);
 }
 
 namespace simgrid {
 namespace kernel {
 namespace resource {
-LinkImpl* NetworkConstantModel::createLink(const std::string& name, double bw, double lat,
-                                           s4u::Link::SharingPolicy policy)
+NetworkConstantModel::NetworkConstantModel() : NetworkModel(Model::UpdateAlgo::FULL)
+{
+  all_existing_models.push_back(this);
+}
+
+LinkImpl* NetworkConstantModel::create_link(const std::string& name, double bw, double lat,
+                                            s4u::Link::SharingPolicy policy)
 {
 
   xbt_die("Refusing to create the link %s: there is no link in the Constant network model. "