openModeller  Version 1.4.0
AlgorithmRun.hh
Go to the documentation of this file.
00001 
00031 #ifndef _ALGORITHM_RUN_HH_
00032 #define _ALGORITHM_RUN_HH_
00033 
00034 #include <openmodeller/om.hh>
00035 
00036 class AlgorithmImpl;
00037 class AlgParameter;
00038 
00039 /****************************************************************/
00040 /************************* AlgorithmRun *************************/
00041 
00047 class AlgorithmRun
00048 {
00049 public:
00050   AlgorithmRun( const AlgorithmPtr& algo );
00051   ~AlgorithmRun();
00052 
00053   int initialize(int id, int comm_samples,
00054      const SamplerPtr& train_sampler, 
00055      const SamplerPtr& test_sampler );
00056   void run();
00057   void stop();
00058 
00059 
00060   void createModel();
00061 
00062   bool running() const;
00063   int getId() const { return _id; }
00064   float getProgress() const;
00065   double getOmission() const;
00066   double getCommission() const;
00067   double getError(int type) const;
00068   Scalar getValue(const Sample& x) const; 
00069 
00070   int calculateOmission();
00071   int calculateCommission();
00072 
00073   AlgorithmPtr getAlgorithm() {return _alg; }
00074 
00075 private:
00076 
00077   AlgorithmPtr _alg;      
00078 
00079   int _id;                   
00080   bool _running;             
00081   double _omission;          
00082   double _commission;        
00083   int _commission_samples;   
00084   SamplerPtr _train_sampler;
00085   SamplerPtr _test_sampler;
00086 
00087   AlgorithmRun( const AlgorithmRun& );
00088   AlgorithmRun& operator=(const AlgorithmRun& );
00089 };
00090 
00091 
00092 #endif
00093