-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathUCT_Simulator.cpp
More file actions
34 lines (28 loc) · 849 Bytes
/
Copy pathUCT_Simulator.cpp
File metadata and controls
34 lines (28 loc) · 849 Bytes
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 "UCT_Simulator.h"
#include <cmath>
UCT_Simulator::UCT_Simulator()
{
}
UCT_Simulator::~UCT_Simulator()
{
}
Node Node::bufferNode[Node::BUFFER_SIZE];
int Node::tail;
void Node::forkChildren(int color) {
static bool next[GoBoard::BOARD_SIZE * GoBoard::BOARD_SIZE];
//board.show();
//system("pause");
//board.generate_all_moves(color, next);
//std::cout << "W1" << std::endl;
for (int i = 0; i < 169; ++i) {
if (next[i]) {
GoBoard child_board = board;
//if (i == 28) std::cout << i << ' ' << I(i) << ' ' << J(i) << ' ' << color << std::endl;
//if (i == 28) child_board.show();
child_board.play_move(I(i), J(i), color);
//if (i == 28) std::cout << "M" << std::endl;
children.push_back(newNode(child_board, I(i), J(i)));
//if (i == 28) std::cout << "T" << std::endl;
}
}
}