ToPS
ProbabilisticModelCreator.hpp
00001 /*
00002  *       ProbabilisticModelCreator.hpp
00003  *
00004  *       Copyright 2011 Andre Yoshiaki Kashiwabara <akashiwabara@usp.br>
00005  *                      Ígor Bonádio <ibonadio@ime.usp.br>
00006  *                      Vitor Onuchic <vitoronuchic@gmail.com>
00007  *                      Alan Mitchell Durham <aland@usp.br>
00008  *
00009  *       This program is free software; you can redistribute it and/or modify
00010  *       it under the terms of the GNU  General Public License as published by
00011  *       the Free Software Foundation; either version 3 of the License, or
00012  *       (at your option) any later version.
00013  *
00014  *       This program is distributed in the hope that it will be useful,
00015  *       but WITHOUT ANY WARRANTY; without even the implied warranty of
00016  *       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017  *       GNU General Public License for more details.
00018  *
00019  *       You should have received a copy of the GNU General Public License
00020  *       along with this program; if not, write to the Free Software
00021  *       Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
00022  *       MA 02110-1301, USA.
00023  */
00024 
00025 #ifndef PROBABILISTIC_MODEL_CREATOR_HPP
00026 #define PROBABILISTIC_MODEL_CREATOR_HPP
00027 
00028 #include "crossplatform.hpp"
00029 
00030 #include "ProbabilisticModel.hpp"
00031 #include "ConfigurationReader.hpp"
00032 
00033 
00034 namespace tops {
00035 
00037   class DLLEXPORT ProbabilisticModelCreator {
00038   public:
00039     ProbabilisticModelCreator () {}
00040     virtual ~ProbabilisticModelCreator () {};
00042 
00043     virtual ProbabilisticModelPtr create( ProbabilisticModelParameters & parameters) const {
00044       ProbabilisticModelPtr n;
00045       not_implemented( "create ()");
00046       return n;
00047     }
00049     virtual ProbabilisticModelPtr create( ProbabilisticModelParameters & parameters, double & loglikelihood, int & sample_size) const {
00050       ProbabilisticModelPtr n;
00051       not_implemented( "create (parameters, loglikelihood)");
00052       return n;
00053     }
00054 
00056     virtual ProbabilisticModelPtr create( ProbabilisticModelParameters & parameters, const std::vector<std::string> & sample_set, double & loglikelihood, int & sample_size) const {
00057       ProbabilisticModelPtr n;
00058       not_implemented( "create (parameters, loglikelihood)");
00059       return n;
00060     }
00061 
00063     virtual ProbabilisticModelPtr create( ProbabilisticModelParameters & parameters, const std::map<std::string,ProbabilisticModelPtr> & models) const {
00064       return create(parameters);
00065     }
00066 
00067 
00069     virtual std::string help() const {
00070       std::string s;
00071       not_implemented( "help()");
00072       return s;
00073     }
00074     virtual void not_implemented( std::string method) const {
00075       std::cerr << "ERROR: Not implemented: " << method << " !" << std::endl;
00076       exit(-1);
00077     }
00078     virtual void setCreator(ProbabilisticModelCreatorPtr creator)  {
00079       not_implemented("setCreator()");
00080       exit(-1);
00081     }
00082 
00083 
00084   };
00085   typedef boost::shared_ptr <ProbabilisticModelCreator> ProbabilisticModelCreatorPtr ;
00086 };
00087 
00088 
00089 #endif