+ return surf_workstation_model->extension.
+ workstation.get_available_speed(workstation->surf_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 astimated 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)
+{
+ SD_CHECK_INIT_DONE();
+ xbt_assert0(workstation != NULL, "Invalid parameter");
+ xbt_assert0(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;
+ int i;
+
+ SD_CHECK_INIT_DONE();
+ xbt_assert0(src != NULL && dst != NULL, "Invalid parameter");
+ links = SD_route_get_list(src, dst);
+ nb_links = SD_route_get_size(src, dst);
+ latency = 0.0;
+
+ for (i = 0; i < nb_links; i++) {
+ latency += SD_link_get_current_latency(links[i]);
+ }
+
+ return latency;
+}
+
+/**
+ * \brief Returns the bandwidth of the route between two workstations, i.e. the minimum link bandwidth of all
+ * between the workstations.
+ *
+ * \param src the first workstation
+ * \param dst the second workstation
+ * \return the bandwidth of the route between the two workstations (in bytes/second)
+ * \see SD_route_get_current_latency()
+ */
+double SD_route_get_current_bandwidth(SD_workstation_t src,
+ SD_workstation_t dst)
+{
+
+ const SD_link_t *links;
+ int nb_links;
+ double bandwidth;
+ double min_bandwidth;
+ int i;
+
+ SD_CHECK_INIT_DONE();
+ xbt_assert0(src != NULL && dst != NULL, "Invalid parameter");
+
+ links = SD_route_get_list(src, dst);
+ nb_links = SD_route_get_size(src, dst);
+ bandwidth = min_bandwidth = -1.0;
+
+
+ for (i = 0; i < nb_links; i++) {
+ bandwidth = SD_link_get_current_bandwidth(links[i]);
+ if (bandwidth < min_bandwidth || min_bandwidth == -1.0)
+ min_bandwidth = bandwidth;
+ }
+
+ return min_bandwidth;
+}
+
+/**
+ * \brief Returns an approximative estimated time for the given
+ * communication amount between two workstations
+ *
+ * \param src the first workstation
+ * \param dst the second workstation
+ * \param communication_amount the communication amount you want to evaluate (in bytes)
+ * \return an approximative astimated computation time for the given communication amount
+ * between the workstations (in seconds)
+ */
+double SD_route_get_communication_time(SD_workstation_t src,
+ SD_workstation_t dst,
+ double communication_amount)
+{
+
+
+ /* total time = latency + transmission time of the slowest link
+ transmission time of a link = communication amount / link bandwidth */
+
+ const SD_link_t *links;
+ int nb_links;
+ double bandwidth, min_bandwidth;
+ double latency;
+ int i;
+
+ SD_CHECK_INIT_DONE();
+ xbt_assert0(src != NULL && dst != NULL, "Invalid parameter");
+ xbt_assert0(communication_amount >= 0,
+ "communication_amount must be greater than or equal to zero");
+
+
+
+ if (communication_amount == 0.0)
+ return 0.0;
+
+ links = SD_route_get_list(src, dst);
+ nb_links = SD_route_get_size(src, dst);
+ min_bandwidth = -1.0;
+ latency = 0;
+
+ for (i = 0; i < nb_links; i++) {
+ latency += SD_link_get_current_latency(links[i]);
+ bandwidth = SD_link_get_current_bandwidth(links[i]);
+ if (bandwidth < min_bandwidth || min_bandwidth == -1.0)
+ min_bandwidth = bandwidth;
+ }
+
+ return latency + (communication_amount / min_bandwidth);