Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
ns3: kill an unused global container :(
[simgrid.git] / src / surf / network_ns3.cpp
index f74f504da32994e742b450234717669a55b6497f..1a81837aca4007985e8cebc8822c4a71e41aad82 100644 (file)
@@ -44,7 +44,6 @@ extern std::map<std::string, SgFlow*> flow_from_sock;
 extern std::map<std::string, ns3::ApplicationContainer> sink_from_sock;
 
 static ns3::InternetStackHelper stack;
-static ns3::NodeContainer nodes;
 static ns3::NodeContainer Cluster_nodes;
 static ns3::Ipv4InterfaceContainer interfaces;
 
@@ -58,7 +57,7 @@ simgrid::xbt::Extension<simgrid::kernel::routing::NetPoint, NetPointNs3> NetPoin
 NetPointNs3::NetPointNs3() : ns3_node_(ns3::CreateObject<ns3::Node>(0))
 {
   stack.Install(ns3_node_);
-  nodes.Add(ns3_node_);
+  Cluster_nodes.Add(ns3_node_);
   node_num = number_of_nodes++;
 }
 
@@ -282,11 +281,11 @@ void NetworkNS3Model::update_actions_state(double now, double delta)
 
 LinkNS3::LinkNS3(NetworkNS3Model* model, const std::string& name, double bandwidth, double latency,
                  s4u::Link::SharingPolicy policy)
-    : LinkImpl(model, name, nullptr)
+    : LinkImpl(model, name, nullptr), sharing_policy_(policy)
 {
   bandwidth_.peak = bandwidth;
   latency_.peak   = latency;
-  sharing_policy_ = policy;
+
   /* If wifi, create the wifizone now. If not, don't do anything: the links will be created in routeCreate_cb */
 
   s4u::Link::on_creation(*this->get_iface());
@@ -438,8 +437,8 @@ void ns3_add_cluster(const char* /*id*/, double bw, double lat)
   }
   number_of_clusters_nodes = Cluster_nodes.GetN();
 
-  XBT_DEBUG("Add router %u to cluster", nodes.GetN() - Nodes.GetN() - 1);
-  Nodes.Add(nodes.Get(nodes.GetN()-Nodes.GetN()-1));
+  // XBT_DEBUG("Add router %u to cluster", nodes.GetN() - Nodes.GetN() - 1);
+  // Nodes.Add(nodes.Get(nodes.GetN()-Nodes.GetN()-1));
 
   xbt_assert(Nodes.GetN() <= 65000, "Cluster with ns-3 is limited to 65000 nodes");
   ns3::CsmaHelper csma;