Also initialize m_hat to NOTSET.
"SURF_ACTION_NOT_IN_THE_SYSTEM"
};
"SURF_ACTION_NOT_IN_THE_SYSTEM"
};
+void Action::initialize(ModelPtr model, double cost, bool failed,
+ lmm_variable_t var)
+{
+ m_priority = 1.0;
+ m_refcount = 1;
+ m_remains = cost;
+ m_maxDuration = NO_MAX_DURATION;
+ m_finish = -1.0;
+ m_failed = failed;
+ m_start = surf_get_clock();
+ m_cost = cost;
+ p_model = model;
+ p_data = NULL;
+ p_variable = var;
+ m_lastValue = 0;
+ m_lastUpdate = 0;
+ m_suspended = false;
+ m_hat = NOTSET;
+}
+
+{
+ initialize(NULL, 0.0, false); // FIXME: not used
+}
Action::Action(ModelPtr model, double cost, bool failed)
Action::Action(ModelPtr model, double cost, bool failed)
- : m_priority(1.0)
- , m_refcount(1)
- , m_remains(cost)
- , m_maxDuration(NO_MAX_DURATION)
- , m_finish(-1.0)
- , m_failed(failed)
- , m_start(surf_get_clock())
- , m_cost(cost)
- , p_model(model)
- , p_data(NULL)
- , p_variable(NULL)
- , m_lastValue(0)
- , m_lastUpdate(0)
- , m_suspended(false)
+ initialize(model, cost, failed);
#ifdef HAVE_TRACING
p_category = NULL;
#endif
#ifdef HAVE_TRACING
p_category = NULL;
#endif
}
Action::Action(ModelPtr model, double cost, bool failed, lmm_variable_t var)
}
Action::Action(ModelPtr model, double cost, bool failed, lmm_variable_t var)
- : m_priority(1.0)
- , m_refcount(1)
- , m_remains(cost)
- , m_maxDuration(NO_MAX_DURATION)
- , m_finish(-1.0)
- , m_failed(failed)
- , m_start(surf_get_clock())
- , m_cost(cost)
- , p_model(model)
- , p_data(NULL)
- , p_variable(var)
- , m_lastValue(0)
- , m_lastUpdate(0)
- , m_suspended(false)
+ initialize(model, cost, failed, var);
#ifdef HAVE_TRACING
p_category = NULL;
#endif
#ifdef HAVE_TRACING
p_category = NULL;
#endif
* @details An action is an event generated by a resource (e.g.: a communication for the network)
*/
class Action : public actionHook, public actionLmmHook {
* @details An action is an event generated by a resource (e.g.: a communication for the network)
*/
class Action : public actionHook, public actionLmmHook {
+private:
+ /**
+ * @brief Common initializations for the constructors
+ */
+ void initialize(ModelPtr model, double cost, bool failed,
+ lmm_variable_t var = NULL);
+
public:
/**
* @brief Action constructor
public:
/**
* @brief Action constructor