-/* Copyright (c) 2007-2013. The SimGrid Team.
- *
- * This program is free software; you can redistribute it and/or modify it
+/* Copyright (c) 2007-2014. The SimGrid Team.
+ * All rights reserved. */
+
+/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
+
#include "network_ns3.hpp"
#include "surf_private.h"
#include "simgrid/sg_config.h"
if(!IPV4addr) IPV4addr = xbt_dynar_new(sizeof(char*),free);
- NetworkLinkPtr net_link = surf_network_model->createResource(link->id,
+ NetworkLinkPtr net_link = surf_network_model->createNetworkLink(link->id,
link->bandwidth,
link->bandwidth_trace,
link->latency,
link->state_trace,
link->policy,
link->properties);
+
xbt_lib_set(link_lib, link->id, SURF_LINK_LEVEL, net_link);
}
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() {
xbt_dict_free(&dict_socket);
}
-NetworkLinkPtr NetworkNS3Model::createResource(const char *name,
+NetworkLinkPtr NetworkNS3Model::createNetworkLink(const char *name,
double bw_initial,
tmgr_trace_t bw_trace,
double lat_initial,
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());
/* 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;