diff --git a/src/networks/model-net/dragonfly-plus.C b/src/networks/model-net/dragonfly-plus.C index 051dbf41fdcda9f8c52a8a9aeb505d30730d745f..929c2649dd038770c8ca2ab818e5df472d9a76c2 100644 --- a/src/networks/model-net/dragonfly-plus.C +++ b/src/networks/model-net/dragonfly-plus.C @@ -3017,18 +3017,18 @@ static Connection do_dfp_routing(router_state *s, if (poss_next_stops.size() < 1) tw_error(TW_LOC, "MINIMAL DEAD END\n"); - int rand_sel = tw_rand_integer(lp->rng, 0, poss_next_stops.size() -1 ); - return poss_next_stops[rand_sel]; - - // ConnectionType conn_type = poss_next_stops[0].conn_type; - // Connection best_min_conn; - // if (conn_type == CONN_GLOBAL) { - // int rand_sel = tw_rand_integer(lp->rng, 0, poss_next_stops.size() -1); - // return poss_next_stops[rand_sel]; - // } - // else - // best_min_conn = get_absolute_best_connection_from_conns(s, bf, msg, lp, poss_next_stops); //gets absolute best - // return best_min_conn; + // int rand_sel = tw_rand_integer(lp->rng, 0, poss_next_stops.size() -1 ); + // return poss_next_stops[rand_sel]; + + ConnectionType conn_type = poss_next_stops[0].conn_type; + Connection best_min_conn; + if (conn_type == CONN_GLOBAL) { + int rand_sel = tw_rand_integer(lp->rng, 0, poss_next_stops.size() -1); + return poss_next_stops[rand_sel]; + } + else + best_min_conn = get_absolute_best_connection_from_conns(s, bf, msg, lp, poss_next_stops); //gets absolute best + return best_min_conn; } else { //routing algorithm is specified in routing