Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Revert "Compilation broken." This wasn't suppose to be commited.
[simgrid.git] / src / include / surf / surf_resource_lmm.h
index b8966be..37c437c 100644 (file)
@@ -1,5 +1,6 @@
 
-/* Copyright (c) 2009 The SimGrid Team. All rights reserved.                */
+/* Copyright (c) 2009, 2010. The SimGrid Team.
+ * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 static XBT_INLINE
 surf_resource_lmm_t surf_resource_lmm_new(size_t childsize,
     /* for superclass */ surf_model_t model, char *name, xbt_dict_t props,
-    lmm_constraint_t constraint,
+    lmm_system_t system, double constraint_value,
     tmgr_history_t history,
     int state_init, tmgr_trace_t state_trace,
-    double metric_init, tmgr_trace_t metric_trace) {
+    double metric_peak, tmgr_trace_t metric_trace) {
 
   surf_resource_lmm_t res = (surf_resource_lmm_t)surf_resource_new(childsize,model,name,props);
 
-  res->constraint = constraint;
+  res->constraint = lmm_constraint_new(system, res, constraint_value);
   res->state_current = state_init;
   if (state_trace)
     res->state_event = tmgr_history_add_trace(history, state_trace, 0.0, 0, res);
 
-  res->power.current = metric_init;
+  res->power.scale = 1.0;
+  res->power.peak = metric_peak;
   if (metric_trace)
     res->power.event = tmgr_history_add_trace(history, metric_trace, 0.0, 0, res);
   return res;