* @brief SURF model interface class
* @details A model is an object which handle the interactions between its Resources and its Actions
*/
-class Model {
+XBT_PUBLIC_CLASS Model {
public:
/**
* @brief Model constructor
* @brief SURF resource interface class
* @details A resource represent an element of a component (e.g.: a link for the network)
*/
-class Resource {
+XBT_PUBLIC_CLASS Resource {
public:
/**
* @brief Resource constructor
const char *p_name;
xbt_dict_t p_properties;
ModelPtr p_model;
- void *p_resource;
bool m_running;
e_surf_resource_state_t m_stateCurrent;
* @brief SURF action interface class
* @details An action is an event generated by a resource (e.g.: a communication for the network)
*/
-class Action : public actionHook, public actionLmmHook {
-public:
+XBT_PUBLIC_CLASS Action : public actionHook, public actionLmmHook {
+private:
/**
- * @brief Action constructor
+ * @brief Common initializations for the constructors
*/
- Action();
+ void initialize(ModelPtr model, double cost, bool failed,
+ lmm_variable_t var = NULL);
+public:
/**
* @brief Action constructor
*
*
* @param delta [TODO]
*/
- void updateMaxDuration(double delta) {double_update(&m_maxDuration, delta);}
+ void updateMaxDuration(double delta) {double_update(&m_maxDuration, delta,sg_surf_precision);}
/**
* @brief Update the remaining time of the current action
*
* @param delta [TODO]
*/
- void updateRemains(double delta) {double_update(&m_remains, delta);}
+ void updateRemains(double delta) {double_update(&m_remains, delta, sg_maxmin_precision*sg_surf_precision);}
/**
* @brief Set the remaining time of the current action
s_xbt_swag_hookup_t p_stateHookup;
+ ModelPtr getModel() {return p_model;}
+
protected:
ActionListPtr p_stateSet;
double m_priority; /**< priority (1.0 by default) */
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;}
-
private:
int resourceUsed(void *resource_id);