//TODO this defaults to min, at time of implementation all connections in conns are of same minimality so their scores compared to each other don't matter on minimality
// compare scores based on the scoring preference ----------------------------------------------------------------------------------------------------
intbest_min_score_index=0;
intbest_non_min_score_index=0;
if(specific_router_type==SPINE)
tw_error(TW_LOC,"ROUTING TO SPINE NOT SUPPORTED\n");//TODO when picking intm_rtr_id at the origin leaf, we need to pick a spine router that has a direct connection to our group!
if(scoring_preference==LOWER){//Lower scores are better
returnpossible_next_conns;//we're there so theres no need to go further. return empty - routing should check if we've arrived before calling this method
}
elseif(my_group_id==specific_group_id){
if(best_min_score<adaptive_threshold){//if our best min score is under the adaptive threshold, then we don't consider non-minimal routes, choose minimal
choose_minimal=true;
if(s->dfp_router_type==SPINE){
if(specific_router_type==SPINE){//Then we need to send to one of our leafs first on local
elseif(best_min_score<=best_non_min_score){//our best min score is over the adaptive threshold. So we compare best min score with best nonmin score. If best min is still better, then we choose minimal.
choose_minimal=true;
else{//Then we have a local connection to the specific router on local
tw_error(TW_LOC,"Something went wrong when trying to send to a spine with connection to spec group\n");
if(best_min_score>=best_non_min_score){//ties go to minimal
choose_minimal=true;
if(specific_router_type==SPINE){//then its not good enough to just send to a spine with a connection to the group, it has to go to a spine that has a direct conn to the spec router id
if(connecting_conns_to_spec.size()>0){//then poss_next_spine is a valid next stop, add my connections to it as possible next stops
possible_next_conns.push_back(poss_next_spine);
}
}
}
else{//then just sending to the group is good enough
possible_next_conns=possible_next_conns_to_group;
}
}
// end scoring stuff ----------------------------------------------------------------------------------------------------------------------------------
}
if(possible_next_conns.size()<1)
tw_error(TW_LOC,"didn't pick any possible next stops!\n");
//we don't need to do anything if the path type is already non-minimal. "Don't revisit decision to route non-minimally after it's been made to be non-minimal"