Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Put the different model in the dtd. Permit the xml validation before parsing.
[simgrid.git] / src / bindings / lua / lua_platf.c
index 5022900..15f54ee 100644 (file)
@@ -325,7 +325,18 @@ int console_AS_open(lua_State *L) {
  mode = lua_tostring(L, -1);
  lua_pop(L, 1);
 
- sg_platf_new_AS_begin(id,mode);
+ int mode_int = A_surfxml_AS_routing_None;
+ if(!strcmp(mode,"Full")) mode_int = A_surfxml_AS_routing_Full;
+ else if(!strcmp(mode,"Floyd")) mode_int = A_surfxml_AS_routing_Floyd;
+ else if(!strcmp(mode,"Dijkstra")) mode_int = A_surfxml_AS_routing_Dijkstra;
+ else if(!strcmp(mode,"DijkstraCache")) mode_int = A_surfxml_AS_routing_DijkstraCache;
+ else if(!strcmp(mode,"RuleBased")) mode_int = A_surfxml_AS_routing_RuleBased;
+ else if(!strcmp(mode,"Vivaldi")) mode_int = A_surfxml_AS_routing_Vivaldi;
+ else if(!strcmp(mode,"Cluster")) mode_int = A_surfxml_AS_routing_Cluster;
+ else if(!strcmp(mode,"none")) mode_int = A_surfxml_AS_routing_None;
+ else xbt_die("Don't have the model name '%s'",mode);
+
+ sg_platf_new_AS_begin(id,mode_int);
 
  return 0;
 }