Qualia  0.2
MultiAgent.h
Go to the documentation of this file.
1 /*
2  * MultiAgent.h
3  *
4  * An agent that is composed of multiple sub-agents.
5  *
6  * This file is part of Qualia https://github.com/sofian/qualia
7  *
8  * (c) 2012 Sofian Audry -- info(@)sofianaudry(.)com
9  *
10  * This program is free software: you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation, either version 3 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program. If not, see <http://www.gnu.org/licenses/>.
22  */
23 
24 #ifndef MULTIAGENT_H_
25 #define MULTIAGENT_H_
26 
27 #include "Agent.h"
28 
29 class MultiAgent: public Agent {
30 public:
33 
35  int nAgents;
36 
37  // TODO: not sure if this should be the case...
39  bool ownsAgents;
40 
46  MultiAgent(int nAgents, Agent** assign=0);
47 
49  virtual ~MultiAgent();
50 
51  // Agent methods.
52  virtual void init();
53  virtual Action* start(const Observation* observation);
54  virtual Action* step(const Observation* observation);
55  virtual void end(const Observation* observation);
56 
61  virtual Observation* extractAgentObservation(int agentIdx, const Observation* observation) = 0;
62 
67  virtual void appendAgentAction(int agentIdx, const Action* agentAction) = 0;
68 
73  virtual Action* combineAgentActions() = 0;
74 };
75 
76 #endif /* MULTIAGENT_H_ */