• Main Page
  • Modules
  • Classes
  • Files
  • File List

D:/Projekt/ECF_trunk/ECF/xcs/Environment.h

00001 #ifndef ENVIRONMENT_H
00002 #define ENVIRONMENT_H
00003 
00004 /* Created: 2.3.2010.
00005 *  Author: dkomlen
00006 */
00007 
00012 class Environment : public EvaluateOp {
00013 
00014 protected:
00015     StateP state;
00016 
00017 public:
00018     virtual GenotypeP getInput() = 0;
00019     //IDEJA: napraviti da se iz datoteke s parametrima učita tag <problem>
00020     //i cijeli proslijedi oklini prilikom inicijalizacije
00021 
00022     //Method for Environment initialization
00023     //It is called at algorithm initialization (XCS::initialize)
00024     virtual bool initialize() =0;
00025 
00026     //Sets environment for next trial
00027     //It is called after isOver() returns true;
00028     virtual bool nextTrial() = 0;
00029 
00030     //Resets environment to initial state
00031     virtual bool reset() = 0;
00032 
00033     virtual bool isOver() { return true; };
00034 
00035     //Method used for action evaluation
00036     //Individual has two genotypes:
00037     //    - last input from the environment
00038     //    - action genotype
00039     virtual FitnessP evaluate (IndividualP ind) =0;
00040 
00041     //Used to determine if the experiment is exploit
00042     //Returns whether next input should be processed
00043     //usefull for testing the system
00044     virtual bool isExploit() { return false; };
00045 
00046 
00047     bool checkState(const StateP state) { return true; };
00048 
00049 };
00050 typedef boost::shared_ptr<Environment> EnvironmentP;
00051 
00052 #endif

Generated on Tue Nov 4 2014 13:04:31 for ECF by  doxygen 1.7.1