X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/b3973f5189df8d8983e47336546fd0259f0e2dab..3880211b850704febd20f1a482b4617919ed9025:/src/surf/network_constant.cpp diff --git a/src/surf/network_constant.cpp b/src/surf/network_constant.cpp index e813122ade..1f17a2c0f3 100644 --- a/src/surf/network_constant.cpp +++ b/src/surf/network_constant.cpp @@ -24,7 +24,7 @@ void surf_network_model_init_Constant() sg_platf_host_add_cb(netcste_count_hosts); - ModelPtr model = static_cast(surf_network_model); + ModelPtr model = surf_network_model; xbt_dynar_push(model_list, &model); } @@ -37,12 +37,8 @@ double NetworkConstantModel::shareResources(double /*now*/) for(ActionList::iterator it(actionSet->begin()), itend(actionSet->end()) ; it != itend ; ++it) { action = static_cast(&*it); - if (action->m_latency > 0) { - if (min < 0) - min = action->m_latency; - else if (action->m_latency < min) - min = action->m_latency; - } + if (action->m_latency > 0 && (min < 0 || action->m_latency < min)) + min = action->m_latency; } return min; @@ -58,7 +54,7 @@ void NetworkConstantModel::updateActionsState(double /*now*/, double delta) action = static_cast(&*it); if (action->m_latency > 0) { if (action->m_latency > delta) { - double_update(&(action->m_latency), delta); + double_update(&(action->m_latency), delta, sg_surf_precision); } else { action->m_latency = 0.0; }