Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
implement a constructor for surf_action_t; draft a surf_action_maxmin_t for actions...
[simgrid.git] / src / include / surf / surf.h
index 1cb37e5b50b6419d2e7e9611b5f956e5867134d6..ce16cd1cb081cc33c05f925a359c76c6c7da8361 100644 (file)
 #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
  *
@@ -31,15 +39,16 @@ SG_BEGIN_DECL()
 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
  */
@@ -81,6 +90,11 @@ XBT_PUBLIC(int) find_model_description(s_surf_model_description_t * table,
        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
  *
@@ -230,7 +244,6 @@ XBT_PUBLIC(int) find_model_description(s_surf_model_description_t * table,
        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;
 
 
@@ -256,9 +269,11 @@ XBT_PUBLIC(int) find_model_description(s_surf_model_description_t * table,
      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 */
@@ -492,22 +507,6 @@ XBT_PUBLIC(void) surf_workstation_model_init_ptask_L07(const char *filename);
 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
  */