X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=src%2Fmodels.h;h=f037071b0843684ce16ccb2e29e94aaac38aeb9a;hb=ca651f2fd25147f88dbb27a27bc79bedcd9e4c81;hp=8d7f9e8a7a7980ffe10634dcc7eb732de43ae2de;hpb=d7c119fefaf9cce07974afbefb4b6a017689a961;p=germs.git diff --git a/src/models.h b/src/models.h index 8d7f9e8..f037071 100644 --- a/src/models.h +++ b/src/models.h @@ -26,41 +26,97 @@ class GeneOrder; namespace Models { +/** + * Basic implementation of a model. All sort actions are considered equal. + */ class ModelImpl { public: virtual ~ModelImpl(); + /** + * All actions return 1 in this model. + * + * \see Model::score + */ virtual double score(const SortAction& sa, const GeneOrder& go); + /** + * \see Model::name + */ virtual const char* name(); }; +/** + * A model that favors symmetric reversal, resulting in an X-like + * picture in a dot plot. + */ class X : public ModelImpl { public: + /** + * Returns a higher score for reversals around the center + * + * \see Model::score + */ double score(const SortAction& sa, const GeneOrder& go); + /** + * \see Model::name + */ const char* name(); }; +/** + * A model that favors short reversals, resulting in a zipper-like + * picture in a dot plot + */ class Zipper : public ModelImpl { public: + /** + * Returns higher score for shorter reversals. + * + * \see Model::score + */ double score(const SortAction& sa, const GeneOrder& go); + /** + * \see Model::name + */ const char* name(); }; +/** + * A model that favors single gene transpositions, resulting in a + * very scattered dot plot. + */ class Cloud : public ModelImpl { public: + /** + * \todo has to be implemented + * \see Model::score + */ double score(const SortAction& sa, const GeneOrder& go); + /** + * \see Model::name + */ const char* name(); }; +/** + * A model similar to X, but a wider X in the dot plot. + */ class FatX : public ModelImpl { public: + /** + * \todo has to be implemented + * \see Model::score + */ double score(const SortAction& sa, const GeneOrder& go); + /** + * \see Model::name + */ const char* name(); };