Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
do not downcast activities to the wrong type just to get their name
[simgrid.git] / src / surf / network_wifi.hpp
index 4092d12c0bd2381a3531aea9df458dc01bf5f91c..ef07cb4d4f1b458279ae0cfa168583aa7fcc923b 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2019. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2019-2020. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -26,6 +26,19 @@ class NetworkWifiLink : public LinkImpl {
   /** @brief A link can have several bandwith attach to it (mostly use by wifi model) */
   std::vector<Metric> bandwidths_;
 
+  /** @brief Should we use the decay model ? */
+  bool use_decay_model_=false;
+  /** @brief Wifi ns-3 802.11n average bit rate */
+  const double wifi_max_rate_=54*1e6 / 8;
+  /** @brief ns-3 802.11n minimum bit rate */
+  const double wifi_min_rate_=41.70837*1e6 / 8;
+  /** @brief Decay model calibration */
+  const int model_n_=5;
+  /** @brief Decay model calibration: bitrate when using model_n_ stations */
+  const double model_rate_=42.61438*1e6 / 8;
+  /** @brief Decay model bandwidths */
+  std::vector<Metric> decay_bandwidths_;
+
 public:
   NetworkWifiLink(NetworkCm02Model* model, const std::string& name, std::vector<double> bandwidths,
                   lmm::System* system);
@@ -38,6 +51,8 @@ public:
   void apply_event(kernel::profile::Event*, double) override { THROW_UNIMPLEMENTED; }
   void set_bandwidth(double) override { THROW_UNIMPLEMENTED; }
   void set_latency(double) override { THROW_UNIMPLEMENTED; }
+  void refresh_decay_bandwidths();
+  bool toggle_decay_model();
 };
 
 } // namespace resource