X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/b3973f5189df8d8983e47336546fd0259f0e2dab..f9e6853d2c5b7b867211700bc12f0ee57f640b30:/src/surf/workstation_ptask_L07.cpp diff --git a/src/surf/workstation_ptask_L07.cpp b/src/surf/workstation_ptask_L07.cpp index 71d2a57037..f44c1a1834 100644 --- a/src/surf/workstation_ptask_L07.cpp +++ b/src/surf/workstation_ptask_L07.cpp @@ -502,11 +502,20 @@ void CpuL07::updateState(tmgr_trace_event_t event_type, double value, double /*d void LinkL07::updateState(tmgr_trace_event_t event_type, double value, double date){ XBT_DEBUG("Updating link %s (%p) with value=%f for date=%g", getName(), this, value, date); if (event_type == p_bwEvent) { - updateBandwidth(value, date); + m_bwCurrent = value; + lmm_update_constraint_bound(ptask_maxmin_system, getConstraint(), m_bwCurrent); if (tmgr_trace_event_free(event_type)) p_bwEvent = NULL; } else if (event_type == p_latEvent) { - updateLatency(value, date); + lmm_variable_t var = NULL; + WorkstationL07ActionPtr action; + lmm_element_t elem = NULL; + + m_latCurrent = value; + while ((var = lmm_get_var_from_cnst(ptask_maxmin_system, getConstraint(), &elem))) { + action = (WorkstationL07ActionPtr) lmm_variable_id(var); + action->updateBound(); + } if (tmgr_trace_event_free(event_type)) p_latEvent = NULL; } else if (event_type == p_stateEvent) { @@ -573,31 +582,11 @@ double LinkL07::getBandwidth() return m_bwCurrent; } -void LinkL07::updateBandwidth(double value, double date) -{ - m_bwCurrent = value; - lmm_update_constraint_bound(ptask_maxmin_system, getConstraint(), m_bwCurrent); -} - double LinkL07::getLatency() { return m_latCurrent; } -void LinkL07::updateLatency(double value, double date) -{ - lmm_variable_t var = NULL; - WorkstationL07ActionPtr action; - lmm_element_t elem = NULL; - - m_latCurrent = value; - while ((var = lmm_get_var_from_cnst(ptask_maxmin_system, getConstraint(), &elem))) { - action = (WorkstationL07ActionPtr) lmm_variable_id(var); - action->updateBound(); - } -} - - bool LinkL07::isShared() { return lmm_constraint_is_shared(getConstraint());