]> ruin.nu Git - germs.git/commitdiff
updated comments
authorMichael Andreen <harv@ruin.nu>
Tue, 14 Aug 2007 11:45:17 +0000 (11:45 +0000)
committerMichael Andreen <harv@ruin.nu>
Tue, 14 Aug 2007 11:45:17 +0000 (11:45 +0000)
src/main.cpp

index 2e074957b459fbd72c3b5b2ada38fd7ca96753bb..d9bce2f37ba2f901c38470a0d0b59ab1f2e323b3 100644 (file)
@@ -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<Gene> g;
        copy(istream_iterator<int>(*in), istream_iterator<int>(),
-                    back_inserter(g));   
+            back_inserter(g));
        GeneOrder go(g.begin(),g.end());
 
-       //TODO: Identify
+       //Identify the model
        ModelIdentifier mi(ann);
        priority_queue<pair<double,Model> > pq = mi.identify(go);
        if (detectModel){
@@ -81,17 +84,17 @@ int main(int argc, char** argv){
        //copy(go.begin(), go.end(), ostream_iterator<int>(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;
 }