Qualia  0.2
Agent.h
Go to the documentation of this file.
1 /*
2  * Agent.h
3  *
4  * Provides an interface for an agent acting within an environment in the Qualia framework.
5  *
6  * This file is part of Qualia https://github.com/sofian/qualia
7  *
8  * (c) 2011 Sofian Audry -- info(@)sofianaudry(.)com
9  *
10  * Based on code from the RL-Glue library (http://rl-glue.googlecode.com)
11  * RL-Glue is licensed under an Apache License 2.0 (compatible with Gnu GPL)
12  *
13  * This program is free software: you can redistribute it and/or modify
14  * it under the terms of the GNU General Public License as published by
15  * the Free Software Foundation, either version 3 of the License, or
16  * (at your option) any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * You should have received a copy of the GNU General Public License
24  * along with this program. If not, see <http://www.gnu.org/licenses/>.
25  */
26 #ifndef AGENT_H_
27 #define AGENT_H_
28 
29 #include <qualia/core/common.h>
30 #include <qualia/core/Action.h>
32 #include <qualia/core/XFile.h>
33 
39 class Agent {
40 
41 public:
42  virtual ~Agent() {}
43 
45  virtual void init() {}
46 
48  virtual Action* start(const Observation* observation) = 0;
49 
51  virtual Action* step(const Observation* observation) = 0;
52 
54  virtual void end(const Observation* observation) {}
55 
57  virtual void save(XFile* file) {}
58 
60  virtual void load(XFile* file) {}
61 };
62 
63 #endif