From: Michael Andreen Date: Tue, 14 Aug 2007 11:45:17 +0000 (+0000) Subject: updated comments X-Git-Tag: v0.1~24 X-Git-Url: https://ruin.nu/git/?p=germs.git;a=commitdiff_plain;h=8e617d91244bf6c8b22503850e10909fa2071c44 updated comments --- diff --git a/src/main.cpp b/src/main.cpp index 2e07495..d9bce2f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -21,6 +21,7 @@ int main(int argc, char** argv){ Model model(0); bool detectModel = true; + //Parse command line arguments int opt; while ((opt = getopt(argc, argv, "m:n:h")) != -1) { switch (opt) { @@ -47,6 +48,7 @@ int main(int argc, char** argv){ } } + //Open file, or stdin istream* in; ifstream file; if (optind == argc || *argv[optind] == '-'){ @@ -59,13 +61,14 @@ int main(int argc, char** argv){ } in = &file; } - //TODO: Parse + + //Parse the gene order permutation vector g; copy(istream_iterator(*in), istream_iterator(), - back_inserter(g)); + back_inserter(g)); GeneOrder go(g.begin(),g.end()); - //TODO: Identify + //Identify the model ModelIdentifier mi(ann); priority_queue > pq = mi.identify(go); if (detectModel){ @@ -81,17 +84,17 @@ int main(int argc, char** argv){ //copy(go.begin(), go.end(), ostream_iterator(cout, " ")); //cout << endl; - //TODO: Chose a sorter + //Sort GeneSorter so; - //TODO: Sort GeneSorter::ActionList al = so.sort(go,model); + //Print the result 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; }