Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
when the value of an event is a negative one, don't update resource
authorsuter <frederic.suter@cc.in2p3.fr>
Mon, 17 Dec 2012 15:30:12 +0000 (16:30 +0100)
committersuter <frederic.suter@cc.in2p3.fr>
Mon, 17 Dec 2012 15:33:38 +0000 (16:33 +0100)
state during presolve. Allows to use default status up to the time (>0)
of the "real" first event.

src/surf/surf.c

index 22aeea5..3cf2263 100644 (file)
@@ -518,9 +518,11 @@ void surf_presolve(void)
             tmgr_history_get_next_event_leq(history, next_event_date,
                                             &value,
                                             (void **) &resource))) {
             tmgr_history_get_next_event_leq(history, next_event_date,
                                             &value,
                                             (void **) &resource))) {
-      resource->model->model_private->update_resource_state(resource,
-                                                            event, value,
-                                                            NOW);
+      if (value >= 0){
+        resource->model->model_private->update_resource_state(resource,
+                                                              event, value,
+                                                              NOW);
+      }
     }
   }
   xbt_dynar_foreach(model_list, iter, model)
     }
   }
   xbt_dynar_foreach(model_list, iter, model)