X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=src%2Fgenesorter.cpp;h=40e62e5b8bab62ae58e55fdc85f0c2f7a486380e;hb=1c14858d7eb8283d147fbe11963d7b32b221a98b;hp=5f8699c62d0991f504520713d18a517fc555a01f;hpb=d0abe1592fcbb10f4ac303e7b66c384624d4d439;p=germs.git diff --git a/src/genesorter.cpp b/src/genesorter.cpp index 5f8699c..40e62e5 100644 --- a/src/genesorter.cpp +++ b/src/genesorter.cpp @@ -24,12 +24,18 @@ #include "sortaction.h" #include "reverseaction.h" +#include "genealgorithms.h" + using namespace std; -GeneSorter::ActionList GeneSorter::sort(const GeneOrder& go1){ +GeneSorter::ActionList GeneSorter::sort(const GeneOrder& go){ return ActionList(); } -GeneSorter::ActionList GeneSorter::safeActions(const GeneOrder& go1){ - return ActionList(); +GeneSorter::ActionList GeneSorter::safeActions(const GeneOrder& go){ + if (countCycles(go) == go.size() - 1) + return ActionList(); + ActionList al; + al.push_back(SortAction(new ReverseAction(2,3))); + return al; }