- lmm_constraint_t p_constraint;
-public:
- lmm_constraint_t getConstraint() {return p_constraint;};
-
-};
-
-/**********
- * Action *
- **********/
-void surf_action_lmm_update_index_heap(void *action, int i);
-
-class Action : public actionHook, public actionLmmHook {
- ActionLmmListPtr p_modifiedSet;
- xbt_heap_t p_actionHeap;
- int m_selectiveUpdate;
- ModelPtr p_model;
- double m_bound; /**< the capping of the CPU use */
- bool m_failed;
- double m_start; /**< start time */
- char *p_category; /**< tracing category for categorized resource utilization monitoring */
-
- #ifdef HAVE_LATENCY_BOUND_TRACKING
- int m_latencyLimited; /**< Set to 1 if is limited by latency, 0 otherwise */
- #endif
- int m_cost;
- void *p_data; /**< for your convenience */
-
-protected:
- ActionListPtr p_stateSet;
- double m_priority; /**< priority (1.0 by default) */
- int m_refcount;
- double m_remains; /**< How much of that cost remains to be done in the currently running task */
- double m_maxDuration; /*< max_duration (may fluctuate until the task is completed) */
- double m_finish; /**< finish time : this is modified during the run and fluctuates until the task is completed */
-
- ModelPtr getModel() {return p_model;}
-
-public:
-
- Action();
- Action(ModelPtr model, double cost, bool failed);
- Action(ModelPtr model, double cost, bool failed, lmm_variable_t var);
- virtual ~Action();
-
- void finish();
- s_xbt_swag_hookup_t p_stateHookup;
-
- e_surf_action_state_t getState(); /**< get the state*/
- virtual void setState(e_surf_action_state_t state); /**< Change state*/
- double getBound() {return m_bound;}
- double getStartTime(); /**< Return the start time of an action */
- double getFinishTime(); /**< Return the finish time of an action */
- void *getData() {return p_data;}
- void setData(void* data);
- double getMaxDuration() {return m_maxDuration;}
- char *getCategory() {return p_category;}
- double getCost() {return m_cost;}
- void setCost(double cost) {m_cost = cost;}
-
- void updateMaxDuration(double delta) {double_update(&m_maxDuration, delta);}
- void updateRemains(double delta) {double_update(&m_remains, delta);}
- void setRemains(double value) {m_remains = value;}
- void setFinishTime(double value) {m_finish = value;}
-
-
- void ref();
- virtual int unref(); /**< Specify that we don't use that action anymore. Returns true if the action was destroyed and false if someone still has references on it. */
- virtual void cancel(); /**< Cancel a running action */
- virtual void recycle(){}; /**< Recycle an action */
-
- virtual void suspend(); /**< Suspend an action */
- virtual void resume(); /**< Resume a suspended action */
- virtual bool isSuspended(); /**< Return whether an action is suspended */
- virtual void setMaxDuration(double duration); /**< Set the max duration of an action*/
- virtual void setPriority(double priority); /**< Set the priority of an action */
-#ifdef HAVE_TRACING
- void setCategory(const char *category); /**< Set the category of an action */
-#endif
- virtual double getRemains(); /**< Get the remains of an action */
- double getRemainsNoUpdate();
-
-#ifdef HAVE_LATENCY_BOUND_TRACKING
- int getLatencyLimited(); /**< Return 1 if action is limited by latency, 0 otherwise */
-#endif