set_load(0, opt::auto_depl::load);
return;
}
- srand48(opt::auto_depl::random_seed);
std::vector<double> loads(hosts.size());
- std::generate(loads.begin(), loads.end(), drand48);
+ if (opt::auto_depl::random_seed != 1) {
+ srand48(opt::auto_depl::random_seed);
+ std::generate(loads.begin(), loads.end(), drand48);
+ } else {
+ std::fill(loads.begin(), loads.end(), 1.0);
+ }
double factor = opt::auto_depl::load /
std::accumulate(loads.begin(), loads.end(), 0.0);
std::transform(loads.begin(), loads.end(), loads.begin(),
DESCR("- initial load (total)", "%g", auto_depl::load);
DESCR("- random initial load distribution", "%s",
h.on_off(auto_depl::random_distribution));
- DESCR("- random seed", "%s",
- h.val_or_string(auto_depl::random_seed, "time based"));
+ DESCR("- random seed", "%s", // NOTE: cannot be 0 here anymore
+ h.val_or_string(auto_depl::random_seed, "constant random", 1UL));
} else {
DESCR("deployment file", "\"%s\"", deployment_file.c_str());
}
<< " [" << opt_helper::on_off(opt::auto_depl::random_distribution)
<< "]\n";
std::clog << o("-r value")
- << "random seed, 0 for a seed based on current date"
+ << "random seed for initial load distribution, or 0, or 1"
<< " [" << opt::auto_depl::random_seed << "]\n";
+ if (opt::help_requested > 1)
+ std::clog << o("") << "- use 0 for a seed based on current date\n"
+ << o("") << "- use 1 for a constant random\n";
std::clog << "\nLoad balancing algorithm:\n";
std::clog << o("-a name") << "load balancing algorithm"