X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/loba.git/blobdiff_plain/fc4b169f4e9a3b0e8c8ae807fdb4c7cf8d3e6507..HEAD:/deployment.cpp?ds=sidebyside diff --git a/deployment.cpp b/deployment.cpp index bbb47e5..0af3e3b 100644 --- a/deployment.cpp +++ b/deployment.cpp @@ -1,12 +1,11 @@ #include #include #include -#include #include #include #include #include -#include +#include #include #include @@ -51,8 +50,6 @@ void deployment_generator::set_link(int host1, int host2) void deployment_generator::distribute_load() { - using std::placeholders::_1; - if (!opt::auto_depl::random_distribution) { set_load(0, opt::auto_depl::load); return; @@ -67,7 +64,7 @@ void deployment_generator::distribute_load() double factor = opt::auto_depl::load / std::accumulate(loads.begin(), loads.end(), 0.0); std::transform(loads.begin(), loads.end(), loads.begin(), - std::bind(std::multiplies(), _1, factor)); + [&factor](double a) { return factor * a; }); if (opt::integer_transfer) { double iload; double residue = 0.0; @@ -96,7 +93,7 @@ void deployment_generator::distribute_load() void deployment_generator::deploy() { - xbt_dynar_t args = xbt_dynar_new(sizeof(const char*), NULL); + xbt_dynar_t args = xbt_dynar_new(sizeof(const char*), nullptr); for (unsigned i = 0 ; i < hosts.size() ; ++i) { const char* hostname = hostdata::at(i).get_name(); std::ostringstream oss;