/* 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. */
/* 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. */
void update(Action* action, double date, ActionHeap::Type type);
void remove(Action* action);
Action* pop();
void update(Action* action, double date, ActionHeap::Type type);
void remove(Action* action);
Action* pop();
STARTED, /**< Currently running */
FAILED, /**< either the resource failed, or the action was canceled */
FINISHED, /**< Successfully completed */
STARTED, /**< Currently running */
FAILED, /**< either the resource failed, or the action was canceled */
FINISHED, /**< Successfully completed */
* @param var The lmm variable associated to this Action if it is part of a LMM component
*/
Action(Model* model, double cost, bool failed, lmm::Variable* var);
* @param var The lmm variable associated to this Action if it is part of a LMM component
*/
Action(Model* model, double cost, bool failed, lmm::Variable* var);
/** @brief Set the user data associated to the current action */
void set_data(void* data) { data_ = data; }
/** @brief Set the user data associated to the current action */
void set_data(void* data) { data_ = data; }
+ /** @brief Get the user data associated to the current action */
+ activity::ActivityImpl* get_activity() const { return activity_; }
+ /** @brief Set the user data associated to the current action */
+ void set_activity(activity::ActivityImpl* activity) { activity_ = activity; }
+
/** @brief Get the cost of the current action */
double get_cost() const { return cost_; }
/** @brief Set the cost of the current action */
/** @brief Get the cost of the current action */
double get_cost() const { return cost_; }
/** @brief Set the cost of the current action */
void ref();
/** @brief Unref that action (and destroy it if refcount reaches 0)
* @return true if the action was destroyed and false if someone still has references on it */
void ref();
/** @brief Unref that action (and destroy it if refcount reaches 0)
* @return true if the action was destroyed and false if someone still has references on it */
/** @brief Get the maximum duration of the current action */
double get_max_duration() const { return max_duration_; }
/** @brief Get the maximum duration of the current action */
double get_max_duration() const { return max_duration_; }
virtual void set_max_duration(double duration);
/** @brief Get the tracing category associated to the current action */
virtual void set_max_duration(double duration);
/** @brief Get the tracing category associated to the current action */
/** @brief Get the priority of the current Action */
double get_priority() const { return sharing_priority_; };
/** @brief Get the priority of the current Action */
double get_priority() const { return sharing_priority_; };
int refcount_ = 1;
double sharing_priority_ = 1.0; /**< priority (1.0 by default) */
double max_duration_ = NO_MAX_DURATION; /*< max_duration (may fluctuate until the task is completed) */
double remains_; /**< How much of that cost remains to be done in the currently running task */
double start_time_; /**< start time */
double finish_time_ = -1; /**< finish time (may fluctuate until the task is completed) */
int refcount_ = 1;
double sharing_priority_ = 1.0; /**< priority (1.0 by default) */
double max_duration_ = NO_MAX_DURATION; /*< max_duration (may fluctuate until the task is completed) */
double remains_; /**< How much of that cost remains to be done in the currently running task */
double start_time_; /**< start time */
double finish_time_ = -1; /**< finish time (may fluctuate until the task is completed) */
double get_last_value() const { return last_value_; }
void set_last_value(double val) { last_value_ = val; }
double get_last_value() const { return last_value_; }
void set_last_value(double val) { last_value_ = val; }