#include "xbt/config.h"
SG_BEGIN_DECL()
+/* Actions and models are higly connected structures... */
+
+/** \brief Model datatype
+ * \ingroup SURF_models
+ *
+ * Generic data structure for a model. The workstations,
+ * the CPUs and the network links are examples of models.
+ */
+ typedef struct surf_model *surf_model_t;
-/* Actions and models are higly connected structures... */
/** \brief Action datatype
* \ingroup SURF_actions
*
typedef struct surf_action *surf_action_t;
/** @Brief Specify that we use that action */
XBT_PUBLIC(void) surf_action_ref(surf_action_t action);
-
-
-/** \brief Model datatype
- * \ingroup SURF_models
+/** @brief Creates a new action.
*
- * Generic data structure for a model. The workstations,
- * the CPUs and the network links are examples of models.
+ * @param size The size is the one of the subtype you want to create
+ * @param cost initial value
+ * @param model to which model we should attach this action
+ * @param failed whether we should start this action in failed mode
*/
- typedef struct surf_model *surf_model_t;
+XBT_PUBLIC(void*) surf_action_new(size_t size,double cost,surf_model_t model, int failed);
+
+
/** \brief Resource model description
*/
surf_model_t model_type;
} s_surf_action_t;
+ typedef struct {
+ s_surf_action_t generic_action;
+ void *variable; /* of type lmm_variable_t, which is only visible by loading maxmin */
+ int suspended;
+ } s_surf_action_maxmin_t,*surf_action_maxmin_t;
/** \brief Action states
* \ingroup SURF_actions
*
void (*set_max_duration) (surf_action_t action, double duration);/**< Set the max duration of an action*/
void (*set_priority) (surf_action_t action, double priority);/**< Set the priority of an action */
- xbt_dict_t(*get_properties) (void *resource_id);/**< Return the properties dictionary */
xbt_dict_t resource_set;
typedef struct surf_resource {
surf_model_t model;
char *name;
+ xbt_dict_t properties;
} s_surf_resource_t, *surf_resource_t;
-XBT_PUBLIC(const char*) surf_resource_name(const void *resource);
+ XBT_PUBLIC(const char*) surf_resource_name(const void *resource);
+ XBT_PUBLIC(xbt_dict_t) surf_resource_properties(const void *resource);
XBT_PUBLIC(void) surf_resource_free(void* resource);
/**************************************/
/* Implementations of model object */
XBT_PUBLIC_DATA(s_surf_model_description_t)
surf_workstation_model_description[];
-/** \brief The network links
- * \ingroup SURF_models
- *
- * This dict contains all network links.
- *
- * \see workstation_set
- */
-XBT_PUBLIC_DATA(xbt_dict_t) link_set;
-
-/** \brief The workstations
- * \ingroup SURF_models
- *
- * This dict contains all workstations.
- *
- * \see link_set
- */
/** \brief List of initialized models
* \ingroup SURF_models
*/