+/**
+ * Update the CPU total energy for a finished action
+ *
+ */
+void update_resource_energy(surf_model_t model, surf_action_lmm_t action)
+{
+ if(model == surf_cpu_model){
+ cpu_Cas01_t cpu_model = (cpu_Cas01_t)lmm_constraint_id(lmm_get_cnst_from_var
+ (model->model_private->maxmin_system,
+ action->variable, 0));
+
+ if( cpu_model->energy->last_updated < surf_get_clock()) {
+ double load = lmm_constraint_get_usage(cpu_model->constraint) / cpu_model->power_peak;
+ cpu_update_energy(cpu_model, load);
+ }
+ }
+}
+
+
+
+