Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
better use of inherency around Model::next_occuring_event_full()
[simgrid.git] / src / surf / ptask_L07.cpp
index 6fed9f2..7a8c2b9 100644 (file)
@@ -36,6 +36,7 @@ namespace surf {
 
 HostL07Model::HostL07Model() : HostModel() {
   maxminSystem_ = lmm_system_new(1);
+  maxminSystem_->solve_fun = &bottleneck_solve;
   surf_network_model = new NetworkL07Model(this,maxminSystem_);
   surf_cpu_model_pm = new CpuL07Model(this,maxminSystem_);
 
@@ -71,12 +72,10 @@ NetworkL07Model::~NetworkL07Model()
 }
 
 
-double HostL07Model::next_occuring_event(double /*now*/)
+double HostL07Model::next_occuring_event(double now)
 {
-  ActionList *runningActions = getRunningActionSet();
-  double min = shareResourcesMaxMin(runningActions, maxminSystem_, bottleneck_solve);
-
-  for (auto it(runningActions->begin()), itend(runningActions->end()); it != itend ; ++it) {
+  double min = HostModel::next_occuring_event_full(now);
+  for (auto it(getRunningActionSet()->begin()), itend(getRunningActionSet()->end()); it != itend ; ++it) {
     L07Action *action = static_cast<L07Action*>(&*it);
     if (action->m_latency > 0 && (min < 0 || action->m_latency < min)) {
       min = action->m_latency;