]> ruin.nu Git - germs.git/blob - src/models.h
Added more doxygen documentation
[germs.git] / src / models.h
1 /***************************************************************************
2  *   Copyright (C) 2006 by Michael Andreen                                 *
3  *   andreen@student.chalmers.se                                           *
4  *                                                                         *
5  *   This program is free software; you can redistribute it and/or modify  *
6  *   it under the terms of the GNU General Public License as published by  *
7  *   the Free Software Foundation; either version 2 of the License, or     *
8  *   (at your option) any later version.                                   *
9  *                                                                         *
10  *   This program is distributed in the hope that it will be useful,       *
11  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
12  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
13  *   GNU General Public License for more details.                          *
14  *                                                                         *
15  *   You should have received a copy of the GNU General Public License     *
16  *   along with this program; if not, write to the                         *
17  *   Free Software Foundation, Inc.,                                       *
18  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA          *
19  ***************************************************************************/
20
21 #ifndef __MODELS_H__
22 #define __MODELS_H__
23
24 class SortAction;
25 class GeneOrder;
26
27 namespace Models {
28
29 /**
30  * Basic implementation of a model. All sort actions are considered equal.
31  */
32 class ModelImpl {
33         public:
34                 virtual ~ModelImpl();
35
36                 /**
37                  * All actions return 1 in this model.
38                  *
39                  * \see Model::score
40                  */
41                 virtual double score(const SortAction& sa, const GeneOrder& go);
42
43                 /**
44                  * \see Model::name
45                  */
46                 virtual const char* name();
47 };
48
49
50 /**
51  * A model that favors symmetric reversal, resulting in an X-like
52  * picture in a dot plot.
53  */
54 class X : public ModelImpl {
55         public:
56                 /**
57                  * Returns a higher score for reversals around the center
58                  *
59                  * \see Model::score
60                  */
61                 double score(const SortAction& sa, const GeneOrder& go);
62
63                 /**
64                  * \see Model::name
65                  */
66                 const char* name();
67 };
68
69 /**
70  * A model that favors short reversals, resulting in a zipper-like
71  * picture in a dot plot
72  */
73 class Zipper : public ModelImpl {
74         public:
75                 /**
76                  * Returns higher score for shorter reversals.
77                  *
78                  * \see Model::score
79                  */
80                 double score(const SortAction& sa, const GeneOrder& go);
81
82                 /**
83                  * \see Model::name
84                  */
85                 const char* name();
86 };
87
88 /**
89  * A model that favors single gene transpositions, resulting in a
90  * very scattered dot plot.
91  */
92 class Cloud : public ModelImpl {
93         public:
94                 /**
95                  * \todo has to be implemented
96                  * \see Model::score
97                  */
98                 double score(const SortAction& sa, const GeneOrder& go);
99
100                 /**
101                  * \see Model::name
102                  */
103                 const char* name();
104 };
105
106 /**
107  * A model similar to X, but a wider X in the dot plot.
108  */
109 class FatX : public ModelImpl {
110         public:
111                 /**
112                  * \todo has to be implemented
113                  * \see Model::score
114                  */
115                 double score(const SortAction& sa, const GeneOrder& go);
116
117                 /**
118                  * \see Model::name
119                  */
120                 const char* name();
121 };
122
123 }
124
125 #endif