X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;ds=sidebyside;f=src%2Fmain.cpp;h=1ead839eee2502e3be6283e27e4c7701aa2466e3;hb=467ca9f6a60b70eeb9353f83f6e5abd40892a464;hp=153aff40e608bce08a91bfe77a4980f017379ca8;hpb=f8575ea6c0982bba5ccf42771b2994d19500c0a3;p=germs.git diff --git a/src/main.cpp b/src/main.cpp index 153aff4..1ead839 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -12,6 +12,7 @@ using namespace std; #include "modelidentifier.h" #include "genesorter.h" #include "sortaction.h" +#include "genealgorithms.h" #include "model.h" int main(int argc, char** argv){ @@ -60,15 +61,27 @@ int main(int argc, char** argv){ //TODO: Identify ModelIdentifier mi(ann); priority_queue > pq = mi.identify(go); - while (pq.size() > 0){ - cout << "Model: " << pq.top().second.name() << " score: " << pq.top().first << endl; - pq.pop(); - } + Model model = pq.top().second; + //while (pq.size() > 0){ + cout << "Model: " << model.name() << " score: " << pq.top().first << endl; + //pq.pop(); + //} + + cout << "Distance: " << inversionDistance(go) << endl; + //copy(go.begin(), go.end(), ostream_iterator(cout, " ")); + //cout << endl; //TODO: Chose a sorter GeneSorter so; //TODO: Sort - GeneSorter::ActionList al = so.sort(go); + GeneSorter::ActionList al = so.sort(go,model); + + double score = 0; + for (GeneSorter::ActionList::iterator sa = al.begin(); sa != al.end(); ++sa){ + cout << "Action: " << sa->toString() << " model score: " << model.score(*sa,go) << endl; + score += model.score(*sa,go); + } + cout << "Avg score: " << score / al.size() << endl; //TODO: Print result return EXIT_SUCCESS; }