X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/f89671e0bd7450461d70d5ced6079123e73c2a63..9c78faf166ce0a2b668a4bdc5e95b21132d5b359:/src/surf/network_wifi.hpp?ds=sidebyside diff --git a/src/surf/network_wifi.hpp b/src/surf/network_wifi.hpp index c84527bfc3..ef07cb4d4f 100644 --- a/src/surf/network_wifi.hpp +++ b/src/surf/network_wifi.hpp @@ -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,18 +26,33 @@ class NetworkWifiLink : public LinkImpl { /** @brief A link can have several bandwith attach to it (mostly use by wifi model) */ std::vector 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 decay_bandwidths_; + public: NetworkWifiLink(NetworkCm02Model* model, const std::string& name, std::vector bandwidths, lmm::System* system); - void set_host_rate(s4u::Host* host, int rate_level); + 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) */ - double get_host_rate(s4u::Host* host); + double get_host_rate(const s4u::Host* host); s4u::Link::SharingPolicy get_sharing_policy() override; 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