Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Change dependence function to mimic the one in AVOCS article
[simgrid.git] / src / mc / mc_global.c
index acbaabf..e924d16 100644 (file)
@@ -103,13 +103,8 @@ void MC_exit(int method)
 
 int MC_random(int min, int max)
 {
-  MC_random_create(min,max);
-  SIMIX_process_yield();
-
-  if(!mc_replay_mode)
-    return mc_current_state->executed_transition->current_value;
-  else
-    return mc_current_state->executed_transition->current_value - 1;
+  MC_trans_intercept_random(min, max);
+  return mc_current_state->executed_transition->random.value;
 }
 
 /**
@@ -237,6 +232,7 @@ void MC_state_delete(mc_state_t state)
   mc_transition_t trans;  
   
   xbt_setset_foreach(state->created_transitions, cursor, trans){
+    xbt_setset_elm_remove(mc_setset, trans);
     MC_transition_delete(trans);
   }