* under the terms of the license (GNU LGPL) which comes with this package. */
#include "surf_private.h"
+#include "surf/maxmin.h"
#include "surf/ns3/ns3_interface.h"
#include "xbt/lib.h"
#include "surf/network_ns3_private.h"
do {
ns3_simulator(min);
time_to_next_flow_completion = ns3_time() - surf_get_clock();
- } while(time_to_next_flow_completion==0.0);
+ } while(double_equals(time_to_next_flow_completion,0));
XBT_DEBUG("min : %f",min);
XBT_DEBUG("ns3 time : %f",ns3_time());
surf_network_model->states.running_action_set;
/* If there are no running flows, just return */
- if (!xbt_swag_size(running_actions))
- return;
+ if (!xbt_swag_size(running_actions)) {
+ while(double_positive(now-ns3_time())) {
+ ns3_simulator(now-ns3_time());
+ }
+ return;
+ }
xbt_dict_foreach(dict_socket,cursor,key,data){
action = (surf_action_network_ns3_t)ns3_get_socket_action(data);