From 515d4fdba2dc82a0b781741f02c2587763ef83a6 Mon Sep 17 00:00:00 2001 From: Neil McGlohon Date: Thu, 31 May 2018 12:21:25 -0400 Subject: [PATCH] Update minimal to only use random for global conns --- src/networks/model-net/dragonfly-plus.C | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/networks/model-net/dragonfly-plus.C b/src/networks/model-net/dragonfly-plus.C index 9a85ea1..80a0b46 100644 --- a/src/networks/model-net/dragonfly-plus.C +++ b/src/networks/model-net/dragonfly-plus.C @@ -2987,16 +2987,14 @@ 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) - // best_min_conn = get_best_connection_from_conns(s, bf, msg, lp, poss_next_stops); //does the pick 2 and compare - // else - // best_min_conn = get_absolute_best_connection_from_conns(s, bf, msg, lp, poss_next_stops); //gets absolute best - // return best_min_conn; + 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 -- 2.26.2