X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/c2525c3b833fd682882943fe047f2d77e1bae5e8..52c11fc61cb2dd17d276c67aaaa522085389c39e:/src/kernel/lmm/maxmin.cpp diff --git a/src/kernel/lmm/maxmin.cpp b/src/kernel/lmm/maxmin.cpp index aace67e8f7..42de20657e 100644 --- a/src/kernel/lmm/maxmin.cpp +++ b/src/kernel/lmm/maxmin.cpp @@ -33,6 +33,11 @@ typedef std::vector dyn_light_t; int Variable::Global_debug_id = 1; int Constraint::Global_debug_id = 1; +System* make_new_maxmin_system(bool selective_update) +{ + return new System(selective_update); +} + int Element::get_concurrency() const { // Ignore element with weight less than one (e.g. cross-traffic) @@ -152,7 +157,6 @@ System::System(bool selective_update) : selective_update_active(selective_update variable_mallocator = xbt_mallocator_new(65536, System::variable_mallocator_new_f, System::variable_mallocator_free_f, nullptr); - solve_fun = &lmm_solve; } System::~System() @@ -486,7 +490,7 @@ void System::print() const } } -void System::solve() +void System::lmm_solve() { if (modified) { XBT_IN("(sys=%p)", this); @@ -494,14 +498,14 @@ void System::solve() * constraints that changed are considered. Otherwise all constraints with active actions are considered. */ if (selective_update_active) - solve(modified_constraint_set); + lmm_solve(modified_constraint_set); else - solve(active_constraint_set); + lmm_solve(active_constraint_set); XBT_OUT(); } } -template void System::solve(CnstList& cnst_list) +template void System::lmm_solve(CnstList& cnst_list) { double min_usage = -1; double min_bound = -1; @@ -536,7 +540,7 @@ template void System::solve(CnstList& cnst_list) elem.make_active(); simgrid::kernel::resource::Action* action = static_cast(elem.variable->id); - if (modified_set_ && not action->isLinkedModifiedSet()) + if (modified_set_ && not action->is_within_modified_set()) modified_set_->push_back(*action); } } @@ -690,11 +694,6 @@ template void System::solve(CnstList& cnst_list) delete[] cnst_light_tab; } -void lmm_solve(System* sys) -{ - sys->solve(); -} - /** \brief Attribute the value bound to var->bound. * * \param var the Variable*