Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Cannot set split-duplex through s4u intf.
authorBruno Donassolo <bruno.donassolo@inria.fr>
Tue, 1 Jun 2021 15:48:47 +0000 (17:48 +0200)
committerBruno Donassolo <bruno.donassolo@inria.fr>
Tue, 1 Jun 2021 15:49:55 +0000 (17:49 +0200)
This makes sense only in XML where it properly creates the
link-up/link-down.

src/s4u/s4u_Link.cpp

index 5badfff..ba86b41 100644 (file)
@@ -94,6 +94,10 @@ Link* Link::set_bandwidth(double value)
 
 Link* Link::set_sharing_policy(Link::SharingPolicy policy)
 {
+  if (policy == SharingPolicy::SPLITDUPLEX)
+    throw std::invalid_argument(std::string("Impossible to set split-duplex for the link: ") + get_name() +
+                                std::string(". You should create a link-up and link-down to emulate this behavior"));
+
   kernel::actor::simcall([this, policy] { pimpl_->set_sharing_policy(policy); });
   return this;
 }