X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/eb5b6b0c3c4d9a38bb205b2c8bc9aeeba8674a25..7cad4f0d54aafeabb7ee95007fc370514c4923a9:/src/surf/network_ns3.cpp diff --git a/src/surf/network_ns3.cpp b/src/surf/network_ns3.cpp index 403e1a5814..789dc98e83 100644 --- a/src/surf/network_ns3.cpp +++ b/src/surf/network_ns3.cpp @@ -66,6 +66,7 @@ static void parse_ns3_add_link(sg_platf_link_cbarg_t link) link->state_trace, link->policy, link->properties); + xbt_lib_set(link_lib, link->id, SURF_LINK_LEVEL, net_link); } @@ -285,7 +286,6 @@ NetworkNS3Model::NetworkNS3Model() : NetworkModel("network NS3") { NS3_HOST_LEVEL = xbt_lib_add_level(host_lib,(void_f_pvoid_t)free_ns3_host); NS3_ASR_LEVEL = xbt_lib_add_level(as_router_lib,(void_f_pvoid_t)free_ns3_host); - NS3_LINK_LEVEL = xbt_lib_add_level(link_lib,(void_f_pvoid_t)free_ns3_link); } NetworkNS3Model::~NetworkNS3Model() { @@ -349,7 +349,7 @@ double NetworkNS3Model::shareResources(double now) do { ns3_simulator(now); time_to_next_flow_completion = ns3_time() - surf_get_clock();//FIXME: use now instead ? - } while(double_equals(time_to_next_flow_completion, 0)); + } while(double_equals(time_to_next_flow_completion, 0, sg_surf_precision)); XBT_DEBUG("min : %f", now); XBT_DEBUG("ns3 time : %f", ns3_time()); @@ -370,7 +370,7 @@ void NetworkNS3Model::updateActionsState(double now, double delta) /* If there are no running flows, just return */ if (!getRunningActionSet()->size()) { - while(double_positive(now-ns3_time())) { + while(double_positive(now-ns3_time(), sg_surf_precision)) { ns3_simulator(now-ns3_time()); } return;