-XBT_PUBLIC_DATA(xbt_dict_t) trace_connect_list_host_avail;
-XBT_PUBLIC_DATA(xbt_dict_t) trace_connect_list_power;
-XBT_PUBLIC_DATA(xbt_dict_t) trace_connect_list_link_avail;
-XBT_PUBLIC_DATA(xbt_dict_t) trace_connect_list_bandwidth;
-XBT_PUBLIC_DATA(xbt_dict_t) trace_connect_list_latency;
-
-/*********
- * Model *
- *********/
-XBT_PUBLIC_DATA(xbt_dynar_t) model_list;
-
-/** @ingroup SURF_interface
- * @brief SURF model interface class
- * @details A model is an object which handle the interactions between its Resources and its Actions
- */
-class Model {
-public:
- /**
- * @brief Model constructor
- *
- * @param name the name of the model
- */
- Model(const char *name);
-
- /**
- * @brief Model destructor
- */
- virtual ~Model();
-
- /**
- * @brief Get the name of the current Model
- *
- * @return The name of the current Model
- */
- const char *getName() {return p_name;}
-
- /**
- * @brief Get the set of [actions](@ref Action) in *ready* state
- *
- * @return The set of [actions](@ref Action) in *ready* state
- */
- virtual ActionListPtr getReadyActionSet() {return p_readyActionSet;}
-
- /**
- * @brief Get the set of [actions](@ref Action) in *running* state
- *
- * @return The set of [actions](@ref Action) in *running* state
- */
- virtual ActionListPtr getRunningActionSet() {return p_runningActionSet;}
-
- /**
- * @brief Get the set of [actions](@ref Action) in *failed* state
- *
- * @return The set of [actions](@ref Action) in *failed* state
- */
- virtual ActionListPtr getFailedActionSet() {return p_failedActionSet;}
-
- /**
- * @brief Get the set of [actions](@ref Action) in *done* state
- *
- * @return The set of [actions](@ref Action) in *done* state
- */
- virtual ActionListPtr getDoneActionSet() {return p_doneActionSet;}
-
- /**
- * @brief Get the set of modified [actions](@ref Action)
- *
- * @return The set of modified [actions](@ref Action)
- */
- virtual ActionLmmListPtr getModifiedSet() {return p_modifiedSet;}
-
- /**
- * @brief Get the maxmin system of the current Model
- *
- * @return The maxmin system of the current Model
- */
- lmm_system_t getMaxminSystem() {return p_maxminSystem;}
-
- /**
- * @brief Get the update mechanism of the current Model
- * @see e_UM_t
- *
- * @return [description]
- */
- e_UM_t getUpdateMechanism() {return p_updateMechanism;}
-
- /**
- * @brief Get Action heap
- * @details [TODO]
- *
- * @return The Action heap
- */
- xbt_heap_t getActionHeap() {return p_actionHeap;}
-
- /**
- * @brief share the resources
- * @details Share the resources between the actions
- *
- * @param now [TODO]
- * @return the date of the next action will finish
- */
- virtual double shareResources(double now);
- virtual double shareResourcesLazy(double now);
- virtual double shareResourcesFull(double now);
- double shareResourcesMaxMin(ActionListPtr running_actions,
- lmm_system_t sys,
- void (*solve) (lmm_system_t));
-
- /**
- * @brief Update state of actions
- * @details [TODO]
- *
- * @param now [TODO]
- * @param delta [TODO]
- */
- virtual void updateActionsState(double now, double delta);
- virtual void updateActionsStateLazy(double now, double delta);
- virtual void updateActionsStateFull(double now, double delta);
-
-protected:
- ActionLmmListPtr p_modifiedSet;
- lmm_system_t p_maxminSystem;
- e_UM_t p_updateMechanism;
- int m_selectiveUpdate;
- xbt_heap_t p_actionHeap;
-
-private:
- const char *p_name;
-
- ActionListPtr p_readyActionSet; /**< Actions in state SURF_ACTION_READY */
- ActionListPtr p_runningActionSet; /**< Actions in state SURF_ACTION_RUNNING */
- ActionListPtr p_failedActionSet; /**< Actions in state SURF_ACTION_FAILED */
- ActionListPtr p_doneActionSet; /**< Actions in state SURF_ACTION_DONE */
-};
-
-/************
- * Resource *
- ************/
-
-/** @ingroup SURF_interface
- * @brief Resource which have a metric handled by a maxmin system
- */
-typedef struct {
- double scale; /**< The scale of the metric */
- double peak; /**< The peak of the metric */
- tmgr_trace_event_t event; /**< The associated trace event associated to the metric */
-} s_surf_metric_t;
-
-/** @ingroup SURF_interface
- * @brief SURF resource interface class
- * @details A resource represent an element of a component (e.g.: a link for the network)
- */
-class Resource {
-public:
- /**
- * @brief Resource constructor
- */
- Resource();
-
- /**
- * @brief Resource constructor
- *
- * @param model Model associated to this Resource
- * @param name The name of the Resource
- * @param props Dictionary of properties associated to this Resource
- */
- Resource(ModelPtr model, const char *name, xbt_dict_t props);
-
- /**
- * @brief Resource constructor
- *
- * @param model Model associated to this Resource
- * @param name The name of the Resource
- * @param props Dictionary of properties associated to this Resource
- * @param constraint The lmm constraint associated to this Resource if it is part of a LMM component
- */
- Resource(ModelPtr model, const char *name, xbt_dict_t props, lmm_constraint_t constraint);
-
- /**
- * @brief Resource constructor
- *
- * @param model Model associated to this Resource
- * @param name The name of the Resource
- * @param props Dictionary of properties associated to this Resource
- * @param stateInit the initial state of the Resource
- */
- Resource(ModelPtr model, const char *name, xbt_dict_t props, e_surf_resource_state_t stateInit);
-
- /**
- * @brief Resource destructor
- */
- virtual ~Resource();
-
- /**
- * @brief Get the Model of the current Resource
- *
- * @return The Model of the current Resource
- */
- ModelPtr getModel();
-
- /**
- * @brief Get the name of the current Resource
- *
- * @return The name of the current Resource
- */
- const char *getName();
-
- /**
- * @brief Get the properties of the current Resource
- *
- * @return The properties of the current Resource
- */
- virtual xbt_dict_t getProperties();
-
- /**
- * @brief Update the state of the current Resource
- * @details [TODO]
- *
- * @param event_type [TODO]
- * @param value [TODO]
- * @param date [TODO]
- */
- virtual void updateState(tmgr_trace_event_t event_type, double value, double date)=0;
-
- /**
- * @brief Check if the current Resource is used
- * @return true if the current Resource is used, false otherwise
- */
- virtual bool isUsed()=0;
-
- /**
- * @brief Check if the current Resource is active
- *
- * @return true if the current Resource is active, false otherwise
- */
- bool isOn();
-
- /**
- * @brief Turn on the current Resource
- */
- void turnOn();
-
- /**
- * @brief Turn off the current Resource
- */
- void turnOff();
-
- /**
- * @brief Get the [state](\ref e_surf_resource_state_t) of the current Resource
- *
- * @return The state of the currenrt Resource
- */
- virtual e_surf_resource_state_t getState();
-
- /**
- * @brief Set the [state](\ref e_surf_resource_state_t) of the current Resource
- *
- * @param state The new state of the current Resource
- */
- virtual void setState(e_surf_resource_state_t state);
-
-private:
- 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;
-
- /* LMM */
-public:
- /**
- * @brief Get the lmm constraint associated to this Resource if it is part of a LMM component
- *
- * @return The lmm constraint associated to this Resource
- */
- lmm_constraint_t getConstraint();
-private:
- lmm_constraint_t p_constraint;
-};