+static void create_hierarchy(routing_component_t current_comp,
+ jed_simgrid_container_t current_container) {
+ xbt_dict_cursor_t cursor = NULL;
+ char *key;
+ routing_component_t elem;
+ network_element_t network_elem;
+
+ if( xbt_dict_length(current_comp->routing_sons) == 0 ) {
+ // I am no AS
+ // add hosts to jedule platform
+ xbt_dynar_t hosts;
+
+ hosts = xbt_dynar_new(sizeof(char*), NULL);
+
+ xbt_dict_foreach(current_comp->to_index, cursor, key, network_elem) {
+ char *hostname;
+ XBT_DEBUG("key %s value %p\n", key, network_elem);
+ //xbt_dynar_push_as(hosts, char*, key);
+ hostname = strdup(key);
+ xbt_dynar_push(hosts, &hostname);
+ }
+
+ jed_simgrid_add_resources(current_container, hosts);
+
+ } else {
+ xbt_dict_foreach(current_comp->routing_sons, cursor, key, elem) {
+ jed_simgrid_container_t child_container;
+ jed_simgrid_create_container(&child_container, elem->name);
+ jed_simgrid_add_container(current_container, child_container);
+ XBT_DEBUG("name : %s\n", elem->name);
+ create_hierarchy(elem, child_container);
+ }
+ }
+}