- switch (zone->routing) {
- case A_surfxml_AS_routing_Cluster:
- new_zone = new simgrid::kernel::routing::ClusterZone(current_routing, zone->id);
- break;
- case A_surfxml_AS_routing_ClusterDragonfly:
- new_zone = new simgrid::kernel::routing::DragonflyZone(current_routing, zone->id);
- break;
- case A_surfxml_AS_routing_ClusterTorus:
- new_zone = new simgrid::kernel::routing::TorusZone(current_routing, zone->id);
- break;
- case A_surfxml_AS_routing_ClusterFatTree:
- new_zone = new simgrid::kernel::routing::FatTreeZone(current_routing, zone->id);
- break;
- case A_surfxml_AS_routing_Dijkstra:
- new_zone = new simgrid::kernel::routing::DijkstraZone(current_routing, zone->id, false);
- break;
- case A_surfxml_AS_routing_DijkstraCache:
- new_zone = new simgrid::kernel::routing::DijkstraZone(current_routing, zone->id, true);
- break;
- case A_surfxml_AS_routing_Floyd:
- new_zone = new simgrid::kernel::routing::FloydZone(current_routing, zone->id);
- break;
- case A_surfxml_AS_routing_Full:
- new_zone = new simgrid::kernel::routing::FullZone(current_routing, zone->id);
- break;
- case A_surfxml_AS_routing_None:
- new_zone = new simgrid::kernel::routing::EmptyZone(current_routing, zone->id);
- break;
- case A_surfxml_AS_routing_Vivaldi:
- new_zone = new simgrid::kernel::routing::VivaldiZone(current_routing, zone->id);
- break;
- default:
- xbt_die("Not a valid model!");
- break;
+ simgrid::kernel::resource::NetworkModel* netmodel =
+ current_routing == nullptr ? surf_network_model : current_routing->network_model_;
+ if (strcasecmp(zone->routing.c_str(), "Cluster") == 0) {
+ new_zone = new simgrid::kernel::routing::ClusterZone(current_routing, zone->id, netmodel);
+ } else if (strcasecmp(zone->routing.c_str(),"ClusterDragonfly") == 0) {
+ new_zone = new simgrid::kernel::routing::DragonflyZone(current_routing, zone->id, netmodel);
+ } else if (strcasecmp(zone->routing.c_str(),"ClusterTorus") == 0) {
+ new_zone = new simgrid::kernel::routing::TorusZone(current_routing, zone->id, netmodel);
+ } else if (strcasecmp(zone->routing.c_str(),"ClusterFatTree") == 0) {
+ new_zone = new simgrid::kernel::routing::FatTreeZone(current_routing, zone->id, netmodel);
+ } else if (strcasecmp(zone->routing.c_str(),"Dijkstra") == 0) {
+ new_zone = new simgrid::kernel::routing::DijkstraZone(current_routing, zone->id, netmodel, false);
+ } else if (strcasecmp(zone->routing.c_str(),"DijkstraCache") == 0) {
+ new_zone = new simgrid::kernel::routing::DijkstraZone(current_routing, zone->id, netmodel, true);
+ } else if (strcasecmp(zone->routing.c_str(),"Floyd") == 0) {
+ new_zone = new simgrid::kernel::routing::FloydZone(current_routing, zone->id, netmodel);
+ } else if (strcasecmp(zone->routing.c_str(),"Full") == 0) {
+ new_zone = new simgrid::kernel::routing::FullZone(current_routing, zone->id, netmodel);
+ } else if (strcasecmp(zone->routing.c_str(),"None") == 0) {
+ new_zone = new simgrid::kernel::routing::EmptyZone(current_routing, zone->id, netmodel);
+ } else if (strcasecmp(zone->routing.c_str(),"Vivaldi") == 0) {
+ new_zone = new simgrid::kernel::routing::VivaldiZone(current_routing, zone->id, netmodel);
+ } else if (strcasecmp(zone->routing.c_str(), "Wifi") == 0) {
+ new_zone = new simgrid::kernel::routing::WifiZone(current_routing, zone->id, netmodel);
+ } else {
+ xbt_die("Not a valid model!");