X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/e18a7b043d161b29d0bf3f5743cb7a570241576a..71c7635f30fb0ac9067f8d1e5cdab4fe992d6291:/src/surf/network_cm02.cpp diff --git a/src/surf/network_cm02.cpp b/src/surf/network_cm02.cpp index 30e3b08d65..d3e8809e05 100644 --- a/src/surf/network_cm02.cpp +++ b/src/surf/network_cm02.cpp @@ -165,7 +165,7 @@ NetworkCm02Model::NetworkCm02Model(void (*specificSolveFun)(lmm_system_t self)) maxminSystem_->solve_fun = specificSolveFun; } -LinkImpl* NetworkCm02Model::createLink(const char* name, double bandwidth, double latency, +LinkImpl* NetworkCm02Model::createLink(const std::string& name, double bandwidth, double latency, e_surf_link_sharing_policy_t policy) { return new NetworkCm02Link(this, name, bandwidth, latency, policy, maxminSystem_); @@ -204,8 +204,7 @@ void NetworkCm02Model::updateActionsStateLazy(double now, double /*delta*/) // assume that flows that reached max_duration have remaining of 0 XBT_DEBUG("Action %p finished", action); action->setRemains(0); - action->finish(); - action->setState(Action::State::done); + action->finish(Action::State::done); action->heapRemove(actionHeap_); } } @@ -259,8 +258,7 @@ void NetworkCm02Model::updateActionsStateFull(double now, double delta) if (((action->getRemains() <= 0) && (lmm_get_variable_weight(action->getVariable()) > 0)) || ((action->getMaxDuration() > NO_MAX_DURATION) && (action->getMaxDuration() <= 0))) { - action->finish(); - action->setState(Action::State::done); + action->finish(Action::State::done); } } } @@ -358,7 +356,7 @@ Action* NetworkCm02Model::communicate(s4u::Host* src, s4u::Host* dst, double siz /************ * Resource * ************/ -NetworkCm02Link::NetworkCm02Link(NetworkCm02Model* model, const char* name, double bandwidth, double latency, +NetworkCm02Link::NetworkCm02Link(NetworkCm02Model* model, const std::string& name, double bandwidth, double latency, e_surf_link_sharing_policy_t policy, lmm_system_t system) : LinkImpl(model, name, lmm_constraint_new(system, this, sg_bandwidth_factor * bandwidth)) { @@ -492,8 +490,7 @@ void NetworkCm02Action::updateRemainingLazy(double now) if ((remains_ <= 0 && (lmm_get_variable_weight(getVariable()) > 0)) || ((maxDuration_ > NO_MAX_DURATION) && (maxDuration_ <= 0))) { - finish(); - setState(Action::State::done); + finish(Action::State::done); heapRemove(getModel()->getActionHeap()); }