Qualia  0.2
Policy.h
Go to the documentation of this file.
1 /*
2  * Policy.h
3  *
4  * This class represents a decision-making policy ie. a mapping from observation (state) to
5  * action. It contains a chooseAction() method that needs to be overriden. Main currently implemented
6  * subclasses are:
7  * - QLearningEGreedyPolicy
8  * - QLearningSoftmaxPolicy
9  * - QLearningEDecreasingPolicy
10  *
11  * (c) 2011 Sofian Audry -- info(@)sofianaudry(.)com
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 
27 #ifndef POLICY_H_
28 #define POLICY_H_
29 
30 #include <qualia/core/Agent.h>
31 
32 class Policy {
33 public:
35  Policy() : agent(0) {}
36  virtual ~Policy() {}
37 
38  virtual void init() {}
39 
40  virtual void setAgent(Agent* agent_) {
41  agent = agent_;
42  }
43 
48  virtual void chooseAction(Action* action, const Observation* observation) = 0;
49 };
50 
51 #endif /* POLICY_H_ */