Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
moved a line for comprehension
[simgrid.git] / src / surf / network_ns3.cpp
index 4271429..824a3bf 100644 (file)
@@ -103,6 +103,7 @@ std::unordered_map<std::string, WifiZone*> WifiZone::wifi_zones;
 
 static void initialize_ns3_wifi() {
     wifi.SetStandard (ns3::WIFI_PHY_STANDARD_80211n_5GHZ);
+
     for (auto host : simgrid::s4u::Engine::get_instance()->get_all_hosts()) {
         const char* wifi_link = host->get_property("wifi_link");
         const char* wifi_mcs = host->get_property("wifi_mcs");
@@ -352,7 +353,6 @@ LinkNS3::LinkNS3(NetworkNS3Model* model, const std::string& name, double bandwid
       ns3::NetDeviceContainer netA;
       WifiZone* zone = WifiZone::by_name(name);
       xbt_assert(zone != 0, "Link name '%s' does not match the 'wifi_link' property of a host.", name.c_str());
-      NetPointNs3* netpoint_ns3 = zone->get_host()->get_netpoint()->extension<NetPointNs3>();     
 
       wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager",
                                     "ControlMode", ns3::StringValue ("HtMcs0"),
@@ -381,6 +381,7 @@ LinkNS3::LinkNS3(NetworkNS3Model* model, const std::string& name, double bandwid
       zone->set_network(number_of_networks);
       zone->set_link(number_of_links);
 
+      NetPointNs3* netpoint_ns3 = zone->get_host()->get_netpoint()->extension<NetPointNs3>(); 
       int nodeNum = netpoint_ns3->node_num;
       if (IPV4addr.size() <= (unsigned)nodeNum)
         IPV4addr.resize(nodeNum + 1);