Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
make trace_connect_list_host_speed private as it should
[simgrid.git] / src / surf / network_interface.cpp
index 1ed38ad..4489f8a 100644 (file)
@@ -158,7 +158,7 @@ double NetworkModel::bandwidthConstraint(double rate, double /*bound*/, double /
   return rate;
 }
 
-double NetworkModel::shareResourcesFull(double now)
+double NetworkModel::next_occuring_event_full(double now)
 {
   NetworkAction *action = NULL;
   ActionList *runningActions = surf_network_model->getRunningActionSet();
@@ -196,18 +196,21 @@ Link::Link(simgrid::surf::NetworkModel *model, const char *name, xbt_dict_t prop
 {
   links->insert({name, this});
 
+  m_latency.scale = 1;
+  m_bandwidth.scale = 1;
   XBT_DEBUG("Create link '%s'",name);
 }
 
 Link::Link(simgrid::surf::NetworkModel *model, const char *name, xbt_dict_t props,
                      lmm_constraint_t constraint,
-                     sg_future_evt_set_t fes,
                        tmgr_trace_t state_trace)
 : Resource(model, name, constraint),
   PropertyHolder(props)
 {
+  m_latency.scale = 1;
+  m_bandwidth.scale = 1;
   if (state_trace)
-    p_stateEvent = fes->add_trace(state_trace, 0.0, this);
+    m_stateEvent = future_evt_set->add_trace(state_trace, 0.0, this);
 
   links->insert({name, this});
   XBT_DEBUG("Create link '%s'",name);
@@ -238,12 +241,12 @@ bool Link::isUsed()
 
 double Link::getLatency()
 {
-  return m_latCurrent;
+  return m_latency.peak * m_latency.scale;
 }
 
 double Link::getBandwidth()
 {
-  return p_speed.peak * p_speed.scale;
+  return m_bandwidth.peak * m_bandwidth.scale;
 }
 
 int Link::sharingPolicy()