-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmcplanner.hh
51 lines (37 loc) · 1019 Bytes
/
mcplanner.hh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/*
* Code by Chris Mansley
*/
#ifndef MCPLANNER_HH
#define MCPLANNER_HH
/* Definition dependencies */
#include "state.hh"
#include "action.hh"
#include "planner.hh"
#include "domain.hh"
#include "chopper.hh"
class MCPlanner : public Planner
{
public:
/** Constructor */
MCPlanner(Domain *d, Chopper *c, double e) : Planner(d, c, e) { }
/** Destructor */
virtual ~MCPlanner( ) { }
/** Plan for one state */
Action plan(State s);
/** Restrict planner by queries */
void setMaxQueries(int queries);
protected:
/** Maximum rollout depth */
int maxDepth;
/** Bookkeeping */
int numInitialSamples;
/** Search (or rollout) state space*/
double search(int depth, State s, bool terminal);
/** Update value */
virtual void updateValue(int depth, SARS *sars, double qvalue) = 0;
/** Select next action (greedily or not) */
virtual Action selectAction(State s, int depth, bool greedy) = 0;
/** Clear out data stuctures */
virtual void reset() = 0;
};
#endif // MCPLANNER_HH