use max_it instead of max_time
This commit is contained in:
parent
715f24e01d
commit
53285b2664
3 changed files with 4 additions and 4 deletions
|
@ -88,7 +88,7 @@ struct bt_t {
|
||||||
bool black_can_move_forward(int _line, int _col);
|
bool black_can_move_forward(int _line, int _col);
|
||||||
bool black_can_move_left(int _line, int _col);
|
bool black_can_move_left(int _line, int _col);
|
||||||
|
|
||||||
bt_move_t get_mcts_move(double);
|
bt_move_t get_mcts_move(int);
|
||||||
bt_move_t get_rand_move();
|
bt_move_t get_rand_move();
|
||||||
bool can_play(bt_move_t _m);
|
bool can_play(bt_move_t _m);
|
||||||
void play(bt_move_t _m);
|
void play(bt_move_t _m);
|
||||||
|
|
|
@ -58,7 +58,7 @@ void genmove() {
|
||||||
printf("= \n\n");
|
printf("= \n\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
bt_move_t m = B.get_mcts_move(1);
|
bt_move_t m = B.get_mcts_move(300);
|
||||||
B.play(m);
|
B.play(m);
|
||||||
if (verbose) {
|
if (verbose) {
|
||||||
m.print(stderr, white_turn, B.nbl);
|
m.print(stderr, white_turn, B.nbl);
|
||||||
|
|
|
@ -276,7 +276,7 @@ void print_vec(bt_t board, std::vector<bt_node_t *> v) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bt_move_t bt_t::get_mcts_move(double max_time) {
|
bt_move_t bt_t::get_mcts_move(int max_it) {
|
||||||
// Init tree
|
// Init tree
|
||||||
bt_node_t *tree = new bt_node_t();
|
bt_node_t *tree = new bt_node_t();
|
||||||
tree->parent = nullptr;
|
tree->parent = nullptr;
|
||||||
|
@ -288,7 +288,7 @@ bt_move_t bt_t::get_mcts_move(double max_time) {
|
||||||
mcts_expansion(tree);
|
mcts_expansion(tree);
|
||||||
|
|
||||||
// MCTS
|
// MCTS
|
||||||
for (int it = 0; it < 300; ++it) {
|
for (int it = 0; it < max_it; ++it) {
|
||||||
// Copy board
|
// Copy board
|
||||||
bt_t copy_b = *this;
|
bt_t copy_b = *this;
|
||||||
|
|
||||||
|
|
Reference in a new issue