]> ruin.nu Git - germs.git/blobdiff - src/genesorter.cpp
minor change
[germs.git] / src / genesorter.cpp
index 8643702250f82ac6b90bbfd08f6b65aaf0e85ee2..8126d6aaa5781336ab03ba3a822f4d72f4c8820d 100644 (file)
@@ -32,13 +32,13 @@ using namespace std;
 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;
 }