X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=src%2Fmodelidentifier.cpp;h=a7c67b82c77c5ed3e01335158755221693b2f09d;hb=69cfdf79b7597ee6133dc3add1a759bc94861fa6;hp=98fae9bbc48c2261dec4648efd6edb3b4733a435;hpb=5cdc3cbecb3bed52346f262dc8d0d0c88e8dba17;p=germs.git diff --git a/src/modelidentifier.cpp b/src/modelidentifier.cpp index 98fae9b..a7c67b8 100644 --- a/src/modelidentifier.cpp +++ b/src/modelidentifier.cpp @@ -22,6 +22,8 @@ #include "genealgorithms.h" #include +#include "models.h" +#include "model.h" using namespace std; @@ -36,7 +38,7 @@ ModelIdentifier::~ModelIdentifier(){ fann_destroy(_ann); } -std::map ModelIdentifier::identify(const GeneOrder& go){ +priority_queue > ModelIdentifier::identify(const GeneOrder& go){ int pos = 0; int neg = 0; for (GeneOrder::iterator g = go.begin(); g != go.end(); ++g){ @@ -78,11 +80,11 @@ std::map ModelIdentifier::identify(const GeneOrde double *output = fann_run(_ann,&input[0]); - map scores; - scores[X] = output[0]; - scores[Zipper] = output[1]; - scores[Whirl] = output[2]; - scores[FatX] = output[3]; - scores[Cloud] = output[4]; + priority_queue > scores; + scores.push(pair(output[0],Model(new Models::X))); + scores.push(pair(output[1],Model(new Models::Zipper))); + scores.push(pair(output[2],Model(new Models::Whirl))); + scores.push(pair(output[3],Model(new Models::FatX))); + scores.push(pair(output[4],Model(new Models::Cloud))); return scores; }