X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/08cb25aa027aa2f86e89fd04f0de3ac319083be2..60219c257731fa65cd006beec0579b8443036fff:/src/surf/surf_interface.cpp?ds=sidebyside diff --git a/src/surf/surf_interface.cpp b/src/surf/surf_interface.cpp index 6a9c6b07f4..66dad3794f 100644 --- a/src/surf/surf_interface.cpp +++ b/src/surf/surf_interface.cpp @@ -393,18 +393,18 @@ Model::~Model(){ delete doneActionSet_; } -double Model::next_occuring_event(double now) +double Model::nextOccuringEvent(double now) { //FIXME: set the good function once and for all if (updateMechanism_ == UM_LAZY) - return next_occuring_event_lazy(now); + return nextOccuringEventLazy(now); else if (updateMechanism_ == UM_FULL) - return next_occuring_event_full(now); + return nextOccuringEventFull(now); else xbt_die("Invalid cpu update mechanism!"); } -double Model::next_occuring_event_lazy(double now) +double Model::nextOccuringEventLazy(double now) { XBT_DEBUG("Before share resources, the size of modified actions set is %zd", modifiedSet_->size()); lmm_solve(maxminSystem_); @@ -471,16 +471,11 @@ double Model::next_occuring_event_lazy(double now) } } -double Model::next_occuring_event_full(double /*now*/) { - return shareResourcesMaxMin(getRunningActionSet(), maxminSystem_, lmm_solve); -} - -double shareResourcesMaxMin(ActionList *runningActions, lmm_system_t sys, void (*solve) (lmm_system_t)) -{ - solve(sys); +double Model::nextOccuringEventFull(double /*now*/) { + maxminSystem_->solve_fun(maxminSystem_); double min = -1; - for(auto it(runningActions->begin()), itend(runningActions->end()); it != itend ; ++it) { + for (auto it(getRunningActionSet()->begin()), itend(getRunningActionSet()->end()); it != itend ; ++it) { Action *action = &*it; double value = lmm_variable_getvalue(action->getVariable()); if (value > 0) {