-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsearchPlayer.xh
34 lines (26 loc) · 942 Bytes
/
searchPlayer.xh
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
#include <state.xh>
#include <driver.xh>
#ifndef _SEARCH_PLAYER_XH
#define _SEARCH_PLAYER_XH
typedef struct GameTree GameTree;
datatype NodeStatus {
Unexpanded();
ExpandedBurn(GameTree *child);
Expanded(vector<GameTree> children, unsigned trials, vector<float> wins);
Leaf(PlayerId winner);
};
struct GameTree {
TurnInfo turn;
Action action;
State state;
GameTree *parent;
datatype NodeStatus status;
};
typedef vector<float> (*PlayoutFn)(State s, PlayerId p, Hand hands[], unsigned depth);
vector<float> playoutHand(State s, PlayerId p, Hand hands[], unsigned depth);
vector<float> rulePlayoutHand(State s, PlayerId p, Hand hands[], unsigned depth);
Player makeSearchPlayer(unsigned numPlayers, unsigned timeout, PlayoutFn playoutHand, unsigned depth);
Player makeHeuristicSearchPlayer(unsigned numPlayers);
Player makeDeepSearchPlayer(unsigned numPlayers);
Player makeRuleSearchPlayer(unsigned numPlayers);
#endif