X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=src%2Fmodel.h;h=4c5f46a8005956dd523cd4edabcf04aa1b2b23b9;hb=4462cded18dd80075c3622e5a87ca6f5f3c84f62;hp=9ebcb23818960d722bbee289a5c299849000330d;hpb=f8575ea6c0982bba5ccf42771b2994d19500c0a3;p=germs.git diff --git a/src/model.h b/src/model.h index 9ebcb23..4c5f46a 100644 --- a/src/model.h +++ b/src/model.h @@ -25,19 +25,44 @@ #include class SortAction; +class GeneOrder; + namespace Models { class ModelImpl; } +/** + * Abstraction of a model. + * + * Handles scoring of specific actions on gene orders. + */ class Model{ public: typedef std::tr1::shared_ptr ModelPointer; + /** + * Constructs a new model. + * + * \param model The actual model implementation. This model takes + * ownership of the new allocated implementation and will delete it. + */ Model(Models::ModelImpl* model); - double score(const SortAction& sa) const; + /** + * Gives the score for the action on a given gene order. + * A better match for this model gives a higher score. + */ + double score(const SortAction& sa, const GeneOrder& go) const; + + /** + * The name for the model used. + */ + const char* name() const; - std::string name() const; + /** + * Creates a model from a name. + */ + static Model modelFactory(const std::string& name); private: ModelPointer _impl;