+ void *surf_link;
+ unsigned int cpt;
+
+ if (sd_global->recyclable_route == NULL) {
+ /* first run */
+ sd_global->recyclable_route = xbt_new(SD_link_t, SD_link_get_number());
+ }
+
+ surf_src = src;
+ surf_dst = dst;
+
+ surf_route = surf_workstation_model_get_route((surf_workstation_model_t)surf_workstation_model,
+ surf_src, surf_dst);
+
+ xbt_dynar_foreach(surf_route, cpt, surf_link) {
+ link_name = surf_resource_name(surf_link);
+ sd_global->recyclable_route[cpt] =
+ xbt_lib_get_or_null(link_lib, link_name, SD_LINK_LEVEL);
+ }
+ return sd_global->recyclable_route;
+}
+
+/**
+ * \brief Returns the number of links on the route between two workstations
+ *
+ * \param src a workstation
+ * \param dst another workstation
+ * \return the number of links on the route between these two workstations
+ * \see SD_route_get_list()
+ */
+int SD_route_get_size(SD_workstation_t src, SD_workstation_t dst)
+{
+ return xbt_dynar_length(surf_workstation_model_get_route(
+ (surf_workstation_model_t)surf_workstation_model, src, dst));
+}
+
+/**
+ * \brief Returns the total power of a workstation
+ *
+ * \param workstation a workstation
+ * \return the total power of this workstation
+ * \see SD_workstation_get_available_power()
+ */
+double SD_workstation_get_power(SD_workstation_t workstation)
+{
+ return surf_workstation_get_speed(workstation, 1.0);
+}
+/**
+ * \brief Returns the amount of cores of a workstation
+ *
+ * \param workstation a workstation
+ * \return the amount of cores of this workstation
+ */
+int SD_workstation_get_cores(SD_workstation_t workstation) {
+ return surf_workstation_get_core(workstation);
+}
+
+/**
+ * \brief Returns the proportion of available power in a workstation
+ *
+ * \param workstation a workstation
+ * \return the proportion of power currently available in this workstation (normally a number between 0 and 1)
+ * \see SD_workstation_get_power()
+ */
+double SD_workstation_get_available_power(SD_workstation_t workstation)
+{
+ return surf_workstation_get_available_speed(workstation);
+}
+
+/**
+ * \brief Returns an approximative estimated time for the given computation amount on a workstation
+ *
+ * \param workstation a workstation
+ * \param computation_amount the computation amount you want to evaluate (in flops)
+ * \return an approximative estimated computation time for the given computation amount on this workstation (in seconds)
+ */
+double SD_workstation_get_computation_time(SD_workstation_t workstation,
+ double computation_amount)
+{
+ xbt_assert(computation_amount >= 0,
+ "computation_amount must be greater than or equal to zero");
+ return computation_amount / SD_workstation_get_power(workstation);
+}
+
+/**
+ * \brief Returns the latency of the route between two workstations, i.e. the sum of all link latencies
+ * between the workstations.
+ *
+ * \param src the first workstation
+ * \param dst the second workstation
+ * \return the latency of the route between the two workstations (in seconds)
+ * \see SD_route_get_current_bandwidth()
+ */
+double SD_route_get_current_latency(SD_workstation_t src,
+ SD_workstation_t dst)
+{
+
+ const SD_link_t *links;
+ int nb_links;
+ double latency;