00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef MULTITRIALS_H
00021 #define MULTITRIALS_H
00022
00023 #include "gaconfig.h"
00024 #include "core/evaluation.h"
00025
00026 namespace farsa {
00027
00037 class FARSA_GA_API MultiTrials : public Evaluation {
00038 public:
00040 MultiTrials( int steps = 1, int trials = 1 );
00042 virtual ~MultiTrials();
00044 void setTrials( int t );
00046 int trials() const;
00048 int currentTrial() const;
00050 void setSteps( int s );
00052 int steps() const;
00054 int currentStep() const;
00055
00062 virtual void configure( ConfigurationParameters& params, QString prefix );
00069 virtual void save( ConfigurationParameters& params, QString prefix );
00071 static void describe( QString type );
00072
00074 virtual MultiTrials* clone() const = 0;
00075
00076 protected:
00078 virtual void mainInit() = 0;
00085 virtual bool trialInit( int trial ) = 0;
00090 virtual void trialStep( int step, int trial ) = 0;
00092 virtual void trialFini( int trial ) = 0;
00094 virtual void mainFini() = 0;
00095
00100 void trialDone();
00101
00109 void remainInCurrentStep(bool remain);
00110
00115 bool remainingInCurrentStep() const;
00116
00117 private:
00119 void init();
00121 void step();
00123 void fini();
00124
00126 int currStep;
00128 int currTrial;
00130 int numTrials;
00132 int numSteps;
00134 bool incrementStep;
00136 bool trialInited;
00137 };
00138
00139 }
00140
00141 #endif