From: Frederic Suter Date: Fri, 2 Sep 2016 17:31:58 +0000 (+0200) Subject: fix a pair of bugs in storageN11 X-Git-Tag: v3_14~426 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/0fd026d28d1b5a8cb97b476859fa2554bee6ae30?ds=inline fix a pair of bugs in storageN11 --- diff --git a/src/surf/storage_n11.cpp b/src/surf/storage_n11.cpp index e23abc2c8a..21fbb424d6 100644 --- a/src/surf/storage_n11.cpp +++ b/src/surf/storage_n11.cpp @@ -174,17 +174,15 @@ void StorageN11Model::updateActionsState(double /*now*/, double delta) action->updateRemains(lmm_variable_getvalue(action->getVariable()) * delta); - if (action->getMaxDuration() != NO_MAX_DURATION) + if (action->getMaxDuration() > NO_MAX_DURATION) action->updateMaxDuration(delta); if(action->getRemainsNoUpdate() > 0 && lmm_get_variable_weight(action->getVariable()) > 0 && action->p_storage->usedSize_ == action->p_storage->size_) { action->finish(); action->setState(Action::State::failed); - } else if ((action->getRemainsNoUpdate() <= 0) && (lmm_get_variable_weight(action->getVariable()) > 0)) { - action->finish(); - action->setState(Action::State::done); - } else if ((action->getMaxDuration() != NO_MAX_DURATION) && (action->getMaxDuration() <= 0)) { + } else if (((action->getRemainsNoUpdate() <= 0) && (lmm_get_variable_weight(action->getVariable()) > 0)) || + ((action->getMaxDuration() > NO_MAX_DURATION) && (action->getMaxDuration() <= 0))) { action->finish(); action->setState(Action::State::done); }