]> AND Public Git Repository - simgrid.git/blobdiff - examples/cpp/energy-wifi/s4u-energy-wifi.cpp
Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Extend the platf-failure example to show how to create an host with its trace program...
[simgrid.git] / examples / cpp / energy-wifi / s4u-energy-wifi.cpp
index 6d1bb89b61c4902a4b826b7b8f3c3e3970996116..b4f0983f0d4b2157fc0dd11ab0851f35bd44e5c2 100644 (file)
@@ -1,3 +1,8 @@
+/* Copyright (c) 2020-2021. 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. */
+
 /**
  * Test the wifi energy plugin
  * Desactivate cross-factor to get round values
@@ -47,13 +52,13 @@ int main(int argc, char** argv)
   engine.load_platform(argv[1]);
 
   // setup WiFi bandwidths
-  const auto* l = simgrid::s4u::Link::by_name("AP1");
-  l->set_host_wifi_rate(simgrid::s4u::Host::by_name("Station 1"), 0);
-  l->set_host_wifi_rate(simgrid::s4u::Host::by_name("Station 2"), 0);
+  const auto* l = engine.link_by_name("AP1");
+  l->set_host_wifi_rate(engine.host_by_name("Station 1"), 0);
+  l->set_host_wifi_rate(engine.host_by_name("Station 2"), 0);
 
   // create the two actors for the test
-  simgrid::s4u::Actor::create("act0", simgrid::s4u::Host::by_name("Station 1"), sender);
-  simgrid::s4u::Actor::create("act1", simgrid::s4u::Host::by_name("Station 2"), receiver);
+  simgrid::s4u::Actor::create("act0", engine.host_by_name("Station 1"), sender);
+  simgrid::s4u::Actor::create("act1", engine.host_by_name("Station 2"), receiver);
 
   engine.run();