Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
a few more implicit conversions removed
[simgrid.git] / src / surf / network_ns3.cpp
index 81839efe3bf8c1f43437cd7fb6f52e35afc534ac..cc893351fa78101e700a6d0afb6e5f99281cc2ba 100644 (file)
@@ -114,6 +114,9 @@ static void zoneCreation_cb(simgrid::s4u::NetZone const& zone)
   wifiPhy.Set("Antennas", ns3::UintegerValue(nss_value));
   wifiPhy.Set("MaxSupportedTxSpatialStreams", ns3::UintegerValue(nss_value));
   wifiPhy.Set("MaxSupportedRxSpatialStreams", ns3::UintegerValue(nss_value));
+#if NS3_MINOR_VERSION > 33
+  wifiPhy.Set("ChannelWidth", ns3::UintegerValue(40));
+#endif
   wifiMac.SetType("ns3::ApWifiMac", "Ssid", ns3::SsidValue(ssid));
 
   mobility.SetMobilityModel("ns3::ConstantPositionMobilityModel");
@@ -158,7 +161,11 @@ static void zoneCreation_cb(simgrid::s4u::NetZone const& zone)
     ns3::Simulator::Schedule(ns3::Seconds(start_time_value), &resumeWifiDevice, device);
   }
 
+#if NS3_MINOR_VERSION < 33
+  // This fails with "The channel width does not uniquely identify an operating channel" on v3.34,
+  // so we specified the ChannelWidth of wifiPhy to 40, above, when creating wifiPhy with v3.34 and higher
   ns3::Config::Set("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Phy/ChannelWidth", ns3::UintegerValue(40));
+#endif
 
   mobility.SetPositionAllocator(positionAllocS);
   mobility.Install(nodes);
@@ -345,7 +352,7 @@ LinkImpl* NetworkNS3Model::create_link(const std::string& name, const std::vecto
 LinkImpl* NetworkNS3Model::create_wifi_link(const std::string& name, const std::vector<double>& bandwidths)
 {
   auto* link = create_link(name, bandwidths);
-  link->set_sharing_policy(s4u::Link::SharingPolicy::WIFI);
+  link->set_sharing_policy(s4u::Link::SharingPolicy::WIFI, {});
   return link;
 }
 
@@ -474,7 +481,7 @@ void LinkNS3::set_latency(double latency)
   latency_.peak = latency;
 }
 
-void LinkNS3::set_sharing_policy(s4u::Link::SharingPolicy policy)
+void LinkNS3::set_sharing_policy(s4u::Link::SharingPolicy policy, const s4u::NonLinearResourceCb& cb)
 {
   sharing_policy_ = policy;
 }