Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'udpor-phase5' into 'master'
[simgrid.git] / docs / source / tuto_network_calibration / dahu_platform_ckmeans.cpp
index 031d5e5189227861590ab9441a4b1d19f09e3161..4ee35849e7d74fcb78da04fd647bdbd15a1001cf 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2022. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2006-2023. 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. */
@@ -18,13 +18,13 @@ class NormalMixture : public Sampler {
   std::mt19937& gen_;
 
 public:
-  NormalMixture(std::mt19937& gen) : gen_(gen) {}
+  explicit NormalMixture(std::mt19937& gen) : gen_(gen) {}
   void append(double mean, double stddev, double prob)
   {
     mixture_.push_back(std::normal_distribution<double>(mean, stddev));
     prob_.push_back(prob);
   }
-  double sample()
+  double sample() override
   {
     std::discrete_distribution<> d(prob_.begin(), prob_.end());
     int index    = d(gen_);
@@ -121,11 +121,11 @@ void load_platform(const sg4::Engine& e)
   auto zone = e.get_netzone_root();
 
   SegmentedRegression seg = read_json_file("pingpong_ckmeans.json", gen, false);
-  zone->set_lat_factor_cb(std::bind(&latency_factor_cb, lat_base, seg, std::placeholders::_1, std::placeholders::_2,
-                                    std::placeholders::_3, std::placeholders::_4, std::placeholders::_5));
+  zone->set_latency_factor_cb(std::bind(&latency_factor_cb, lat_base, seg, std::placeholders::_1, std::placeholders::_2,
+                                        std::placeholders::_3, std::placeholders::_4, std::placeholders::_5));
 
-  zone->set_bw_factor_cb(std::bind(&bw_factor_cb, bw_base, seg, std::placeholders::_1, std::placeholders::_2,
-                                   std::placeholders::_3, std::placeholders::_4, std::placeholders::_5));
+  zone->set_bandwidth_factor_cb(std::bind(&bw_factor_cb, bw_base, seg, std::placeholders::_1, std::placeholders::_2,
+                                          std::placeholders::_3, std::placeholders::_4, std::placeholders::_5));
 
   seg = read_json_file("send_ckmeans.json", gen);
   smpi_register_op_cost_callback(SmpiOperation::SEND, std::bind(&smpi_cost_cb, seg, std::placeholders::_1,