X-Git-Url: https://ruin.nu/git/?p=germs.git;a=blobdiff_plain;f=src%2Fmain.cpp;h=1c6a85ecc85790716e6a8559e1ea86117d716922;hp=34ac34fbfc54cfa749900b90d337cd3a4b9be66f;hb=90e2c43b99205b0d7a300209011231cd8d11f7a0;hpb=cc8cefc83ca7216594d937b839673efafeee68f4 diff --git a/src/main.cpp b/src/main.cpp index 34ac34f..1c6a85e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -15,6 +15,13 @@ using namespace std; typedef pair modelpair; +struct ScoreCmp { + template + bool operator()(T s1, T s2){ + return s1.first < s2.first; + } +}; + int main(int argc, char** argv){ string ann = "default.ann"; @@ -61,9 +68,16 @@ 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){ - cout << "Model: " << m->first << " score: " << m->second << endl; + if (m->second > 0){ + pq.push(pair(m->second,m->first)); + } + } + while (pq.size() > 0){ + cout << "Model: " << mi.modelName(pq.top().second) << " score: " << pq.top().first << endl; + pq.pop(); } //TODO: Chose a sorter