use max_it instead of max_time

This commit is contained in:
Mylloon 2023-04-07 15:39:27 +02:00
parent 715f24e01d
commit 53285b2664
Signed by: Anri
GPG key ID: A82D63DFF8D1317F
3 changed files with 4 additions and 4 deletions

View file

@ -88,7 +88,7 @@ struct bt_t {
bool black_can_move_forward(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();
bool can_play(bt_move_t _m);
void play(bt_move_t _m);

View file

@ -58,7 +58,7 @@ void genmove() {
printf("= \n\n");
return;
}
bt_move_t m = B.get_mcts_move(1);
bt_move_t m = B.get_mcts_move(300);
B.play(m);
if (verbose) {
m.print(stderr, white_turn, B.nbl);

View file

@ -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
bt_node_t *tree = new bt_node_t();
tree->parent = nullptr;
@ -288,7 +288,7 @@ bt_move_t bt_t::get_mcts_move(double max_time) {
mcts_expansion(tree);
// MCTS
for (int it = 0; it < 300; ++it) {
for (int it = 0; it < max_it; ++it) {
// Copy board
bt_t copy_b = *this;