openModeller  Version 1.4.0
consensus.hh
Go to the documentation of this file.
00001 
00027 #ifndef _CONSENSUS_ALGHH_
00028 #define _CONSENSUS_ALGHH_
00029 
00030 #include <vector>
00031 #include <string>
00032 
00033 #include <openmodeller/om.hh>
00034 
00035 /**********************************************/
00036 /************* Consensus algorithm ************/
00037 
00041 class ConsensusAlgorithm : public AlgorithmImpl
00042 {
00043 public:
00044 
00045   ConsensusAlgorithm();
00046 
00047   ~ConsensusAlgorithm();
00048 
00049   int needNormalization();
00050   int initialize();
00051   int iterate();
00052   float getProgress() const;
00053   int done() const;
00054 
00055   Scalar getValue( const Sample& x ) const;
00056   int getConvergence( Scalar * const val ) const;
00057 
00058 protected:
00059 
00060   void _getConfiguration( ConfigurationPtr& ) const;
00061 
00062   void _setConfiguration( const ConstConfigurationPtr& );
00063 
00064   bool _setAlgorithm( std::string alg_str );
00065 
00066   bool _done;
00067 
00068   bool _initialized;
00069 
00070   Sample _weights;
00071   Scalar _sum_weights;
00072   Sample _thresholds;
00073 
00074   vector<AlgorithmPtr> _algs;
00075 
00076   int _num_algs;
00077 
00078   int _agreement;
00079 
00080   vector<Normalizer*> _norms;
00081 };
00082 
00083 
00084 #endif
00085