-
Notifications
You must be signed in to change notification settings - Fork 50
/
player_module.hpp
59 lines (46 loc) · 1.31 KB
/
player_module.hpp
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
52
53
54
55
56
57
58
59
#ifndef __PURE_CFR_PURE_CFR_PLAYER_HPP__
#define __PURE_CFR_PURE_CFR_PLAYER_HPP__
/* player_module.hpp
* Richard Gibson, Jul 26, 2013
* Email: richard.g.gibson@gmail.com
*
* Player module class that provides an interface for actually playing
* poker with a dealer and looking up action probabilities.
*
* Copyright (C) 2013 by Richard Gibson
*/
/* C / C++ / STL indluces */
#include <sys/stat.h>
/* project_acpc_server includes */
extern "C" {
#include "acpc_server_code/game.h"
#include "acpc_server_code/rng.h"
}
/* Pure CFR includes */
#include "parameters.hpp"
#include "abstract_game.hpp"
#include "entries.hpp"
class PlayerModule {
public:
PlayerModule( const char *player_file );
virtual ~PlayerModule( );
virtual const AbstractGame *get_abstract_game( ) const { return ag; }
virtual void get_action_probs( State &state,
double action_probs
[ MAX_ABSTRACT_ACTIONS ],
int bucket = -1 );
virtual Action get_action( State &state );
protected:
virtual void get_default_action_probs( State &state,
double action_probs
[ MAX_ABSTRACT_ACTIONS ] ) const;
const AbstractGame *ag;
rng_state_t rng;
bool verbose;
Entries *entries[ MAX_ROUNDS ];
struct stat sb;
void *dump_start;
};
void print_player_file( const Parameters ¶ms,
const char *filename_prefix );
#endif