Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Refactoring of commit 1ebb8e111d904fea559e48ec193c1f7c5dee2245.
authorLoic Guegan <manzerberdes@gmx.com>
Fri, 5 Jul 2019 08:07:57 +0000 (10:07 +0200)
committerLoic Guegan <manzerberdes@gmx.com>
Fri, 5 Jul 2019 08:07:57 +0000 (10:07 +0200)
src/surf/link_wifi.cpp
src/surf/link_wifi.hpp

index 761feaa..fa99474 100644 (file)
@@ -9,9 +9,18 @@ namespace simgrid {
 namespace kernel {
 namespace resource {
 
+NetworkWifiLink::NetworkWifiLink(NetworkCm02Model* model, const std::string& name, std::vector<double> bandwidths,
+                                 s4u::Link::SharingPolicy policy, lmm::System* system)
+    : NetworkCm02Link(model, name, 0, 0, policy, system)
+{
+  for (auto bandwith : bandwidths) {
+    bandwidths_.push_back({bandwith, 1.0, nullptr});
+  }
+}
+
 void NetworkWifiLink::set_host_rate(sg_host_t host, int rate_level)
 {
-  host_rates.insert(std::make_pair(host->get_name(), rate_level));
+  host_rates_.insert(std::make_pair(host->get_name(), rate_level));
 }
 } // namespace resource
 } // namespace kernel
index 20f4179..9aa5d91 100644 (file)
@@ -17,12 +17,18 @@ namespace resource {
 
 class NetworkWifiLink : public NetworkCm02Link {
   /** @brief Hold every rates association between host and links (host name, rates id) */
-  std::map<xbt::string, int> host_rates;
+  std::map<xbt::string, int> host_rates_;
 
   /** @brief Hold every rates available for this Access Point */
   // double* rates; FIXME: unused
 
+  /** @brief A link can have several bandwith attach to it (mostly use by wifi model) */
+  std::vector<Metric> bandwidths_;
+
 public:
+  NetworkWifiLink(NetworkCm02Model* model, const std::string& name, std::vector<double> bandwidths,
+                  s4u::Link::SharingPolicy policy, lmm::System* system);
+
   void set_host_rate(sg_host_t host, int rate_level);
 };