mcts4j icon indicating copy to clipboard operation
mcts4j copied to clipboard

Questions about mcts4j code

Open chwflhs opened this issue 7 years ago • 3 comments

Hi, I have read your code of mcts4j (Monte-Carlo_tree_search) carefully and found it quite useful for me, it is really a nice work.

However, I tested the program and found I cant get the correct answer. I think there still some problem in the code.

To do the test, I printed the execute steps of tic-tac-toe. The steps are given in the attached figure. Results varies in different tests, but many have similar problem:

In the attached figure (test 1), the problem is in turn 7.the correct move for O should be (1;2), but O moved (0;1) instead. So X moved (1;2) and win.

In the attached figure (test 2), the problem is in turn 6.the correct move for O should be (2;2), but ) moved (0;0) instead. Then in turn 7, the correct move for X should be (2;2), but X moved (1;0).

mcts test

From the test result, I think the problem is related with the selection function. Currently i'm not sure of the exactly problem location and don't konw how to fix it so i write to ask your help.

chwflhs avatar Feb 19 '18 05:02 chwflhs

I have found 1 possible reason for this, but maybe not all the reason, given in attached figure.

The setTerminal step: I understand it is used to visit all the tree without reiteration, however, next time when doTransition function execute, all the nodes is already flagged as terminal? need to be reset? test

chwflhs avatar Feb 20 '18 16:02 chwflhs

thanks for the feedback, I'll look into this ;-)

avianey avatar Feb 26 '18 08:02 avianey

rewrote the code... but havn't look into this while rewriting... As of today, setTerminal only means its a leaf Node corresponding to end of game But terminal should also be optimized to hold the info that the whole subtree has been explored/expanded (to avoid reiteration)

avianey avatar Oct 07 '19 12:10 avianey