]> AND Public Git Repository - simgrid.git/blobdiff - src/surf/network_interface.cpp
Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Use existing helper function to create zones.
[simgrid.git] / src / surf / network_interface.cpp
index f1403fabe4b3adcda3927218d6fd0275b6ca7bc8..2cb1cdfb4da17d1dddbc1694ae148cfa204929fc 100644 (file)
@@ -61,9 +61,6 @@ LinkImpl::LinkImpl(const std::string& name) : Resource_T(name), piface_(this)
   if (name != "__loopback__")
     xbt_assert(not s4u::Link::by_name_or_null(name), "Link '%s' declared several times in the platform.", name.c_str());
 
-  latency_.scale   = 1;
-  bandwidth_.scale = 1;
-
   s4u::Engine::get_instance()->link_register(name, &piface_);
   XBT_DEBUG("Create link '%s'", name.c_str());
 }
@@ -132,6 +129,9 @@ void LinkImpl::turn_off()
 
 void LinkImpl::seal()
 {
+  if (is_sealed())
+    return;
+
   xbt_assert(this->get_model(), "Cannot seal Link(%s) without setting the Network model first", this->get_cname());
   Resource::seal();
   s4u::Link::on_creation(piface_);