/* 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. */
/* 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. */
- DatedValue val(0, -1);
- StochasticDatedValue stoval(0, -1);
- event_list.push_back(val);
- stochastic_event_list.push_back(stoval);
+ event_list.emplace_back(0, -1);
+ stochastic_event_list.emplace_back(0, -1);
* and get an iterator over the integrated trace */
Event* Profile::schedule(FutureEvtSet* fes, resource::Resource* resource)
{
* and get an iterator over the integrated trace */
Event* Profile::schedule(FutureEvtSet* fes, resource::Resource* resource)
{
- if (event->free_me == false) { // In the case there is an element, we draw the next event
- StochasticDatedValue stodateVal = stochastic_event_list.at(event->idx);
- futureDV = stochastic_event_list.at(event->idx).get_datedvalue();
+ if (not event->free_me) { // In the case there is an element, we draw the next event
+ futureDV = stochastic_event_list.at(event->idx).get_datedvalue();
Profile* Profile::from_string(const std::string& name, const std::string& input, double periodicity)
{
int linecount = 0;
Profile* Profile::from_string(const std::string& name, const std::string& input, double periodicity)
{
int linecount = 0;
simgrid::kernel::profile::DatedValue* last_event = &(profile->event_list.back());
xbt_assert(trace_list.find(name) == trace_list.end(), "Refusing to define trace %s twice", name.c_str());
simgrid::kernel::profile::DatedValue* last_event = &(profile->event_list.back());
xbt_assert(trace_list.find(name) == trace_list.end(), "Refusing to define trace %s twice", name.c_str());
std::vector<std::string> splittedval((std::istream_iterator<std::string>(iss)),
std::istream_iterator<std::string>());
std::vector<std::string> splittedval((std::istream_iterator<std::string>(iss)),
std::istream_iterator<std::string>());
i = 2;
} else if (splittedval[0] == "NORM" || splittedval[0] == "NORMAL" || splittedval[0] == "GAUSS" ||
splittedval[0] == "GAUSSIAN") {
i = 2;
} else if (splittedval[0] == "NORM" || splittedval[0] == "NORMAL" || splittedval[0] == "GAUSS" ||
splittedval[0] == "GAUSSIAN") {
j = 1;
} else if (splittedval[i] == "NORM" || splittedval[i] == "NORMAL" || splittedval[i] == "GAUSS" ||
splittedval[i] == "GAUSSIAN") {
j = 1;
} else if (splittedval[i] == "NORM" || splittedval[i] == "NORMAL" || splittedval[i] == "GAUSS" ||
splittedval[i] == "GAUSSIAN") {
- XBT_ATTRIB_UNUSED int res = sscanf(val.c_str(), "%lg %lg\n", &event.date_, &event.value_);
- xbt_assert(res == 2, "%s:%d: Syntax error in trace\n%s", name.c_str(), linecount, input.c_str());
+ xbt_assert(sscanf(val.c_str(), "%lg %lg\n", &event.date_, &event.value_) == 2,
+ "%s:%d: Syntax error in trace\n%s", name.c_str(), linecount, input.c_str());
xbt_assert(last_event->date_ <= event.date_,
"%s:%d: Invalid trace: Events must be sorted, but time %g > time %g.\n%s", name.c_str(), linecount,
last_event->date_, event.date_, input.c_str());
last_event->date_ = event.date_ - last_event->date_;
xbt_assert(last_event->date_ <= event.date_,
"%s:%d: Invalid trace: Events must be sorted, but time %g > time %g.\n%s", name.c_str(), linecount,
last_event->date_, event.date_, input.c_str());
last_event->date_ = event.date_ - last_event->date_;
xbt_assert(not path.empty(), "Cannot parse a trace from an empty filename");
xbt_assert(trace_list.find(path) == trace_list.end(), "Refusing to define trace %s twice", path.c_str());
xbt_assert(not path.empty(), "Cannot parse a trace from an empty filename");
xbt_assert(trace_list.find(path) == trace_list.end(), "Refusing to define trace %s twice", path.c_str());
xbt_assert(not f->fail(), "Cannot open file '%s' (path=%s)", path.c_str(), (boost::join(surf_path, ":")).c_str());
std::stringstream buffer;
buffer << f->rdbuf();
xbt_assert(not f->fail(), "Cannot open file '%s' (path=%s)", path.c_str(), (boost::join(surf_path, ":")).c_str());
std::stringstream buffer;
buffer << f->rdbuf();