X-Git-Url: https://ruin.nu/git/?p=germs.git;a=blobdiff_plain;f=src%2Fmain.cpp;h=153aff40e608bce08a91bfe77a4980f017379ca8;hp=1c6a85ecc85790716e6a8559e1ea86117d716922;hb=f8575ea6c0982bba5ccf42771b2994d19500c0a3;hpb=67df9f01df85be7e0ddcc0d53c89534aae009ed9 diff --git a/src/main.cpp b/src/main.cpp index 1c6a85e..153aff4 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -12,15 +12,7 @@ using namespace std; #include "modelidentifier.h" #include "genesorter.h" #include "sortaction.h" - -typedef pair modelpair; - -struct ScoreCmp { - template - bool operator()(T s1, T s2){ - return s1.first < s2.first; - } -}; +#include "model.h" int main(int argc, char** argv){ @@ -67,16 +59,9 @@ int main(int argc, char** argv){ //TODO: Identify ModelIdentifier mi(ann); - map scores = mi.identify(go); - priority_queue,vector >, ScoreCmp > pq; - for (map::iterator m = scores.begin(); - m != scores.end(); ++m){ - if (m->second > 0){ - pq.push(pair(m->second,m->first)); - } - } + priority_queue > pq = mi.identify(go); while (pq.size() > 0){ - cout << "Model: " << mi.modelName(pq.top().second) << " score: " << pq.top().first << endl; + cout << "Model: " << pq.top().second.name() << " score: " << pq.top().first << endl; pq.pop(); }