}
}
-void NetworkCm02Model::update_actions_state_full(double now, double delta)
+void NetworkCm02Model::update_actions_state_full(double /*now*/, double delta)
{
for (auto it = std::begin(*get_started_action_set()); it != std::end(*get_started_action_set());) {
NetworkCm02Action& action = static_cast<NetworkCm02Action&>(*it);
}
action.update_remains(action.get_variable()->get_value() * delta);
- if (action.get_max_duration() > NO_MAX_DURATION)
+ if (action.get_max_duration() != NO_MAX_DURATION)
action.update_max_duration(delta);
if (((action.get_remains() <= 0) && (action.get_variable()->get_weight() > 0)) ||
- ((action.get_max_duration() > NO_MAX_DURATION) && (action.get_max_duration() <= 0))) {
+ ((action.get_max_duration() != NO_MAX_DURATION) && (action.get_max_duration() <= 0))) {
action.finish(Action::State::FINISHED);
}
}
"You're trying to send data from %s to %s but there is no connecting path between these two hosts.",
src->get_cname(), dst->get_cname());
- bool failed = std::any_of(route.begin(), route.end(), [](LinkImpl* link) { return link->is_off(); });
+ bool failed = std::any_of(route.begin(), route.end(), [](const LinkImpl* link) { return not link->is_on(); });
if (cfg_crosstraffic) {
dst->route_to(src, back_route, nullptr);
if (not failed)
- failed = std::any_of(back_route.begin(), back_route.end(), [](LinkImpl* const& link) { return link->is_off(); });
+ failed =
+ std::any_of(back_route.begin(), back_route.end(), [](const LinkImpl* link) { return not link->is_on(); });
}
NetworkCm02Action *action = new NetworkCm02Action(this, size, failed);
return;
double delta = now - get_last_update();
- double max_duration = get_max_duration();
if (get_remains_no_update() > 0) {
XBT_DEBUG("Updating action(%p): remains was %f, last_update was: %f", this, get_remains_no_update(),
XBT_DEBUG("Updating action(%p): remains is now %f", this, get_remains_no_update());
}
- if (max_duration > NO_MAX_DURATION) {
- double_update(&max_duration, delta, sg_surf_precision);
- set_max_duration(max_duration);
- }
+ update_max_duration(delta);
if ((get_remains_no_update() <= 0 && (get_variable()->get_weight() > 0)) ||
- ((max_duration > NO_MAX_DURATION) && (max_duration <= 0))) {
+ ((get_max_duration() != NO_MAX_DURATION) && (get_max_duration() <= 0))) {
finish(Action::State::FINISHED);
get_model()->get_action_heap().remove(this);
}