GeneSorter::ActionList GeneSorter::sort(const GeneOrder& go){
ActionList al;
GeneOrder temp(go);
- while(countCycles(temp) != temp.size() - 1){
+ while(inversionDistance(go) > 0){
ActionList safe = safeActions(go);
if (safe.size() > 0){
safe[0](temp);
al.push_back(safe[0]);
}else
- return ActionList(); //TODO: Need to handle other cases here.
+ return ActionList(); //TODO: Need to handle hurdles.
}
return al;
}