-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsofiai.h
41 lines (34 loc) · 1.04 KB
/
sofiai.h
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
#ifndef SOFIAI_H
#define SOFIAI_H
#include "board.h"
#include "common.h"
typedef tuple<float, int, int> MinimaxNode;
typedef pair<float, Coords> CoordsValue;
typedef vector<CoordsValue> VecCoordsValue;
class Sofiai {
static unsigned int g_seed;
public:
Sofiai(Board *b);
~Sofiai();
void set_coeff();
Board *gb();
void print_board();
Coords next_move();
MinimaxNode minimax(Board b, int x, int y, int depth, bool is_maximizer,
float alpha, float beta);
float eval_state(Board &b, int depth);
void analyze_pt(Board &b, Stone o, Stone x, int mode);
void find_pt(Board &b, int i, int j, Stone o, Stone x, string pt);
bool find_pt_inline(Board &b, int i, int j, int di, int dj, Stone o, Stone x,
string pt);
Stone char_to_stone(char ch, Stone o, Stone x);
VecCoords get_child(Board &b, int mode);
private:
Board *p_board;
Stone cb[N][N];
public:
map<string, pair<float, VecCoords>> lookup_pattern;
map<string, float> lookup_coeff;
map<string, float> lookup_priority;
};
#endif