Automatic commit
[universe.git] / intelligence.h
1
2 // Written and (C) by Francois Fleuret
3 // Contact <francois.fleuret@idiap.ch> for comments & bug reports
4
5 #include "map.h"
6 #include "approximer.h"
7 #include "manipulator.h"
8
9 class Intelligence {
10   int _nb_actions;
11   Map *_input;
12   Manipulator *_manipulator;
13   int _max_memory_tick, _memory_tick;
14   scalar_t *_memory, *_rewards;
15   int *_actions;
16   MappingApproximer **_q_predictors;
17   int _nb_weak_learners;
18 public:
19   Intelligence(Map *input, Manipulator *manipulator, int max_memory_tick, int nb_weak_learners);
20   ~Intelligence();
21   void load(istream &is);
22   void save(ostream &os);
23   void update(int last_action, scalar_t last_reward);
24   void save_memory(char *filename);
25   void load_memory(char *filename);
26   void learn(scalar_t proportion_for_training);
27   int best_action();
28 };