+ // case 3: link has two hosts
+ else if (!src_node->is_router() && !dst_node->is_router()){
+ xbt_assert0(!(is_router(src) || is_router(dst)), "Cannot add a router to host-host link");
+
+ //if both are hosts, the order doesn't matter.
+ if (src_node->include(src)){
+ if (dst_node->include(dst)){
+ //nothing
+ }else{
+ dst_node->add_host(dst);
+ hosts_[dst] = dst_node->id();
+ }
+ }else if (src_node->include(dst)){
+ if (dst_node->include(src)){
+ //nothing
+ }else{
+ dst_node->add_host(src);
+ hosts_[src] = dst_node->id();
+ }
+ }else if (dst_node->include(src)){
+ if (src_node->include(dst)){
+ //nothing
+ }else{
+ src_node->add_host(dst);
+ hosts_[dst] = src_node->id();
+ }
+ }else if (dst_node->include(dst)){
+ if (src_node->include(src)){
+ //nothing
+ }else{
+ src_node->add_host(src);
+ hosts_[src] = src_node->id();
+ }
+ }else{
+ src_node->add_host(src);
+ dst_node->add_host(dst);
+ hosts_[src] = src_node->id();
+ hosts_[dst] = dst_node->id();
+ }
+
+ }
+ else{
+ xbt_assert0(0, "Shouldn't be here");