- if (!xbt_swag_size(running_actions))
- return -1.0;
-
- ns3_simulator(min);
- time_to_next_flow_completion = ns3_time() - surf_get_clock();
+ if (!xbt_swag_size(running_actions) || min == 0.0)
+ return -1.0;
+ else
+ do {
+ ns3_simulator(min);
+ time_to_next_flow_completion = ns3_time() - surf_get_clock();
+ } while(double_equals(time_to_next_flow_completion,0));
+
+ XBT_DEBUG("min : %f",min);
+ XBT_DEBUG("ns3 time : %f",ns3_time());
+ XBT_DEBUG("surf time : %f",surf_get_clock());
+ XBT_DEBUG("Next completion %f :",time_to_next_flow_completion);