#include "model.h"
#include "models.h"
+#include <stdexcept>
+
Model::Model(Models::ModelImpl* model): _impl(model){
}
-double Model::score(const SortAction& sa) const{
- return _impl->score(sa);
+double Model::score(const SortAction& sa, const GeneOrder& go) const{
+ return _impl->score(sa, go);
}
-std::string Model::name() const{
+const char* Model::name() const{
return _impl->name();
}
bool operator<(const Model& lh,const Model& rh){
return &lh < &rh;
}
+
+Model Model::modelFactory(const std::string& name){
+ if (name == "X"){
+ return Model(new Models::X());
+ }else if(name == "Whirl" || name == "Standard"){
+ return Model(new Models::ModelImpl());
+ }else if(name == "Zipper"){
+ return Model(new Models::Zipper());
+ }else if(name == "FatX"){
+ return Model(new Models::FatX());
+ }else if(name == "Cloud"){
+ return Model(new Models::Cloud());
+ }
+ throw std::invalid_argument(name + " is not a valid model");
+}