X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=src%2Fmain.cpp;h=1ead839eee2502e3be6283e27e4c7701aa2466e3;hb=467ca9f6a60b70eeb9353f83f6e5abd40892a464;hp=94109b4e4cce83e47329ce482186e44b740722f7;hpb=d7c119fefaf9cce07974afbefb4b6a017689a961;p=germs.git diff --git a/src/main.cpp b/src/main.cpp index 94109b4..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,go) << endl; + score += model.score(*sa,go); } + cout << "Avg score: " << score / al.size() << endl; //TODO: Print result return EXIT_SUCCESS; }