X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=src%2Fmodelidentifier.h;h=a42e0efb7097fe05ed34a8175c9a05633baf5d18;hb=67df9f01df85be7e0ddcc0d53c89534aae009ed9;hp=bbf30377ad7eef88c243cb92dd6454d5b834dcac;hpb=47b1f5c0294e079bc120dc8366977951aa0778bf;p=germs.git diff --git a/src/modelidentifier.h b/src/modelidentifier.h index bbf3037..a42e0ef 100644 --- a/src/modelidentifier.h +++ b/src/modelidentifier.h @@ -24,7 +24,10 @@ #include "geneorder.h" #include +#include +#include +struct fann; /** * Identifies the model this gene order belongs to @@ -32,15 +35,36 @@ */ class ModelIdentifier{ public: + //TODO: Make a Model class with functions for scoring SortActions + //one subclass for each model. Possibly storing name as string too. enum Model{Whirl,X,FatX,Zipper,Cloud}; + /** + * Creates a new identifier given an artificial neural network + * + * \param ann filename, including path, to the neural network + * + * \throws std::invalid_argument exception if the ann could not be + * opened + */ + ModelIdentifier(std::string ann); + /** * Identifies the model for a given gene order. - * \returns a map with the model as key and the score between 0 and 1 + * + * \returns a map with the model as key and the score between -1 and 1 */ std::map identify(const GeneOrder& go); - virtual ~ModelIdentifier(){}; + static std::string modelName(Model m); + + ~ModelIdentifier(); + private: + fann* _ann; + + //disable for the moment + void operator=(const ModelIdentifier&){} + }; #endif