ECF 1.5
Environment.h
1#ifndef ENVIRONMENT_H
2#define ENVIRONMENT_H
3
4/* Created: 2.3.2010.
5* Author: dkomlen
6*/
7
12class Environment : public EvaluateOp {
13
14protected:
15 StateP state;
16
17public:
18 virtual GenotypeP getInput() = 0;
19 //IDEJA: napraviti da se iz datoteke s parametrima učita tag <problem>
20 //i cijeli proslijedi oklini prilikom inicijalizacije
21
22 //Method for Environment initialization
23 //It is called at algorithm initialization (XCS::initialize)
24 virtual bool initialize() =0;
25
26 //Sets environment for next trial
27 //It is called after isOver() returns true;
28 virtual bool nextTrial() = 0;
29
30 //Resets environment to initial state
31 virtual bool reset() = 0;
32
33 virtual bool isOver() { return true; };
34
35 //Method used for action evaluation
36 //Individual has two genotypes:
37 // - last input from the environment
38 // - action genotype
39 virtual FitnessP evaluate (IndividualP ind) =0;
40
41 //Used to determine if the experiment is exploit
42 //Returns whether next input should be processed
43 //usefull for testing the system
44 virtual bool isExploit() { return false; };
45
46
47 bool checkState(const StateP state) { return true; };
48
49};
50typedef boost::shared_ptr<Environment> EnvironmentP;
51
52#endif
Environment for the XCS algorithm.
Definition: Environment.h:12
virtual FitnessP evaluate(IndividualP ind)=0
Evaluate a single individual. Method must create and return a Fitness object.
Evaluation base class.
Definition: EvaluateOp.h:17