XBT_DEBUG("CPU create: peak=%f, pstate=%d", m_powerPeak, m_pstate);
m_core = core;
- m_stateCurrent = stateInitial;
+ setState(stateInitial);
if (powerTrace)
p_powerEvent = tmgr_history_add_trace(history, powerTrace, 0.0, 0, static_cast<ResourcePtr>(this));
xbt_assert(m_core == 1, "FIXME: add state change code also for constraint_core[i]");
if (value > 0) {
- if(m_stateCurrent == SURF_RESOURCE_OFF)
+ if(getState() == SURF_RESOURCE_OFF)
xbt_dynar_push_as(host_that_restart, char*, (char *)getName());
- m_stateCurrent = SURF_RESOURCE_ON;
+ setState(SURF_RESOURCE_ON);
} else {
lmm_constraint_t cnst = getConstraint();
- m_stateCurrent = SURF_RESOURCE_OFF;
+ setState(SURF_RESOURCE_OFF);
while ((var = lmm_get_var_from_cnst(surf_cpu_model_pm->getMaxminSystem(), cnst, &elem))) {
ActionPtr action = static_cast<ActionPtr>(lmm_variable_id(var));
{
XBT_IN("(%s,%g)", getName(), size);
- CpuCas01ActionPtr action = new CpuCas01Action(surf_cpu_model_pm, size, m_stateCurrent != SURF_RESOURCE_ON,
+ CpuCas01ActionPtr action = new CpuCas01Action(surf_cpu_model_pm, size, getState() != SURF_RESOURCE_ON,
m_powerScale * m_powerPeak, getConstraint());
XBT_OUT();
duration = MAX(duration, MAXMIN_PRECISION);
XBT_IN("(%s,%g)", getName(), duration);
- CpuCas01ActionPtr action = new CpuCas01Action(surf_cpu_model_pm, 1.0, m_stateCurrent != SURF_RESOURCE_ON,
+ CpuCas01ActionPtr action = new CpuCas01Action(surf_cpu_model_pm, 1.0, getState() != SURF_RESOURCE_ON,
m_powerScale * m_powerPeak, getConstraint());