X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;ds=sidebyside;f=src%2Fmain.cpp;h=1ead839eee2502e3be6283e27e4c7701aa2466e3;hb=467ca9f6a60b70eeb9353f83f6e5abd40892a464;hp=90d3564d3d39fc08ae7fc48cb45610b146703f5d;hpb=efe42ca948704593c847996d0ae8da71d15bb75b;p=germs.git diff --git a/src/main.cpp b/src/main.cpp index 90d3564..1ead839 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -67,18 +67,21 @@ int main(int argc, char** argv){ //pq.pop(); //} - cout << "Distance: " << inversionDistance(go) << " : "; - copy(go.begin(), go.end(), ostream_iterator(cout, " ")); - cout << endl; + 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,model); + double score = 0; for (GeneSorter::ActionList::iterator sa = al.begin(); sa != al.end(); ++sa){ - cout << "Action: " << sa->toString() << " model score: " << model.score(*sa) << endl; + 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; }