Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
reorganize *LinkImpl stuff
[simgrid.git] / src / kernel / resource / WifiLinkImpl.hpp
similarity index 67%
rename from src/surf/network_wifi.hpp
rename to src/kernel/resource/WifiLinkImpl.hpp
index 71850b5..63e449b 100644 (file)
@@ -8,7 +8,7 @@
 
 #include <xbt/base.h>
 
-#include "network_cm02.hpp"
+#include "src/surf/network_cm02.hpp"
 #include "xbt/string.hpp"
 
 /***********
@@ -19,9 +19,9 @@ namespace simgrid {
 namespace kernel {
 namespace resource {
 
-class XBT_PRIVATE NetworkWifiAction;
+class XBT_PRIVATE WifiLinkAction;
 
-class NetworkWifiLink : public LinkImpl {
+class WifiLinkImpl : public StandardLinkImpl {
   /** @brief Hold every rates association between host and links (host name, rates id) */
   std::map<xbt::string, int> host_rates_;
 
@@ -29,20 +29,20 @@ class NetworkWifiLink : public LinkImpl {
   std::vector<Metric> bandwidths_;
 
   /** @brief Should we use the decay model ? */
-  bool use_decay_model_=false;
+  bool use_decay_model_ = false;
   /** @brief Wifi maximal bit rate according to the ns-3 802.11n standard */
   const double wifi_max_rate_ = 54 * 1e6 / 8;
   /** @brief minimum bit rate observed with ns3 during our calibration experiments */
   const double wifi_min_rate_ = 41.70837 * 1e6 / 8;
   /** @brief Amount of stations used in the reference point to rescale SimGrid predictions to fit ns-3 ones */
-  const int model_n_=5;
+  const int model_n_ = 5;
   /** @brief Bit rate observed on ns3 at the reference point used for rescaling */
-  const double model_rate_=42.61438*1e6 / 8;
+  const double model_rate_ = 42.61438 * 1e6 / 8;
   /** @brief The bandwidth to use for each SNR level, corrected with the decay rescale mechanism */
   std::vector<Metric> decay_bandwidths_;
 
 public:
-  NetworkWifiLink(const std::string& name, const std::vector<double>& bandwidths, lmm::System* system);
+  WifiLinkImpl(const std::string& name, const std::vector<double>& bandwidths, lmm::System* system);
 
   void set_host_rate(const s4u::Host* host, int rate_level);
   /** @brief Get the AP rate associated to the host (or -1 if not associated to the AP) */
@@ -57,24 +57,23 @@ public:
   int get_host_count() const;
 };
 
-class NetworkWifiAction : public NetworkCm02Action {
-  NetworkWifiLink* src_wifi_link_;
-  NetworkWifiLink* dst_wifi_link_;
+class WifiLinkAction : public NetworkCm02Action {
+  WifiLinkImpl* src_wifi_link_;
+  WifiLinkImpl* dst_wifi_link_;
 
 public:
-  NetworkWifiAction() = delete;
-  NetworkWifiAction(Model* model, s4u::Host& src, s4u::Host& dst, double cost, bool failed,
-                    NetworkWifiLink* src_wifi_link, NetworkWifiLink* dst_wifi_link)
-      : NetworkCm02Action(model, src, dst, cost, failed)
-      , src_wifi_link_(src_wifi_link)
-      , dst_wifi_link_(dst_wifi_link)
-    {}
-
-  NetworkWifiLink* get_src_link() const { return src_wifi_link_; }
-  NetworkWifiLink* get_dst_link() const { return dst_wifi_link_; }
+  WifiLinkAction() = delete;
+  WifiLinkAction(Model* model, s4u::Host& src, s4u::Host& dst, double cost, bool failed, WifiLinkImpl* src_wifi_link,
+                 WifiLinkImpl* dst_wifi_link)
+      : NetworkCm02Action(model, src, dst, cost, failed), src_wifi_link_(src_wifi_link), dst_wifi_link_(dst_wifi_link)
+  {
+  }
+
+  WifiLinkImpl* get_src_link() const { return src_wifi_link_; }
+  WifiLinkImpl* get_dst_link() const { return dst_wifi_link_; }
 };
 
 } // namespace resource
 } // namespace kernel
 } // namespace simgrid
-#endif /* SURF_NETWORK_WIFI_HPP_ */
+#endif