+static void init_randomness(void)
+{
+ random_id = A_surfxml_random_id;
+ random_min = surf_parse_get_double(A_surfxml_random_min);
+ random_max = surf_parse_get_double(A_surfxml_random_max);
+ random_mean = surf_parse_get_double(A_surfxml_random_mean);
+ random_std_deviation = surf_parse_get_double(A_surfxml_random_std_deviation);
+ random_generator = A_surfxml_random_generator;
+}
+
+static void add_randomness(void)
+{
+ /* If needed aditional properties can be added by using the prop tag */
+ random_data_t random =
+ random_new(random_generator, 0, random_min, random_max, random_mean,
+ random_std_deviation);
+ xbt_dict_set(random_data_list, random_id, (void *) random,
+ &xbt_free_ref);
+}
+
+/**
+ * create CPU resource via CPU Model
+ */
+void* surf_host_create_resource(char *name, double power_peak,
+ double power_scale,
+ tmgr_trace_t power_trace, int core,
+ e_surf_resource_state_t state_initial,
+ tmgr_trace_t state_trace,
+ xbt_dict_t cpu_properties)
+{
+ return surf_cpu_model->extension.cpu.create_resource(name, power_peak,
+ power_scale,
+ power_trace,
+ core,
+ state_initial,
+ state_trace,
+ cpu_properties);
+}
+
+/**
+ * create CPU resource via worsktation_ptask_L07 model
+ */
+
+void* surf_wsL07_host_create_resource(char *name, double power_peak,
+ double power_scale,
+ tmgr_trace_t power_trace,
+ e_surf_resource_state_t state_initial,
+ tmgr_trace_t state_trace,
+ xbt_dict_t cpu_properties)
+{
+ return surf_workstation_model->extension.workstation.cpu_create_resource(name,
+ power_peak,
+ power_scale,
+ power_trace,
+ state_initial,
+ state_trace,
+ cpu_properties);
+}
+
+/**
+ * create link resource via network Model
+ */
+void* surf_link_create_resource(char *name,
+ double bw_initial,
+ tmgr_trace_t bw_trace,
+ double lat_initial,
+ tmgr_trace_t lat_trace,
+ e_surf_resource_state_t
+ state_initial,
+ tmgr_trace_t state_trace,
+ e_surf_link_sharing_policy_t policy,
+ xbt_dict_t properties)
+{
+ return surf_network_model->extension.network.create_resource(name,
+ bw_initial,
+ bw_trace,
+ lat_initial,
+ lat_trace,
+ state_initial,
+ state_trace,
+ policy,
+ properties);
+}
+
+/**
+ * create link resource via workstation_ptask_L07 model
+ */
+
+void* surf_wsL07_link_create_resource(char *name,
+ double bw_initial,
+ tmgr_trace_t bw_trace,
+ double lat_initial,
+ tmgr_trace_t lat_trace,
+ e_surf_resource_state_t
+ state_initial,
+ tmgr_trace_t state_trace,
+ e_surf_link_sharing_policy_t
+ policy, xbt_dict_t properties)
+{
+ return surf_workstation_model->extension.workstation.
+ link_create_resource(name, bw_initial, bw_trace, lat_initial,
+ lat_trace, state_initial, state_trace, policy,
+ properties);
+}
+
+/*
+ * add host to the network element list
+ */
+void surf_route_add_host(const char *host_id)
+{
+ routing_add_host(host_id);
+}
+
+/**
+ * set route
+ */
+void surf_routing_add_route(const char *src_id, const char *dst_id,
+ xbt_dynar_t links_id)
+{
+ unsigned int i;
+ const char *link_id;
+ routing_set_route(src_id, dst_id);
+ xbt_dynar_foreach(links_id, i, link_id) {
+ routing_add_link(link_id);
+ }
+
+ //store the route
+ routing_store_route();
+}
+
+/**
+ * Add Traces
+ */
+void surf_add_host_traces(void)
+{
+ return surf_cpu_model->extension.cpu.add_traces();
+}
+
+void surf_add_link_traces(void)
+{
+ return surf_network_model->extension.network.add_traces();