Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Specify visibility (hide warning).
[simgrid.git] / src / surf / link_wifi.cpp
1 /* Copyright (c) 2013-2019. The SimGrid Team. All rights reserved.          */
2
3 /* This program is free software; you can redistribute it and/or modify it
4  * under the terms of the license (GNU LGPL) which comes with this package. */
5
6 #include "src/surf/link_wifi.hpp"
7
8 namespace simgrid {
9 namespace kernel {
10 namespace resource {
11
12 NetworkWifiLink::NetworkWifiLink(NetworkCm02Model* model, const std::string& name, std::vector<double> bandwidths,
13                                  s4u::Link::SharingPolicy policy, lmm::System* system)
14     : NetworkCm02Link(model, name, 0, 0, policy, system)
15 {
16   for (auto bandwith : bandwidths) {
17     bandwidths_.push_back({bandwith, 1.0, nullptr});
18   }
19 }
20
21 void NetworkWifiLink::set_host_rate(sg_host_t host, int rate_level)
22 {
23   host_rates_.insert(std::make_pair(host->get_name(), rate_level));
24 }
25 } // namespace resource
26 } // namespace kernel
27 } // namespace simgrid