mjcorriere / MCTS

Monte Carlo Tree Search AI
1 stars 1 forks source link

Where is a "tree search" ? #1

Open putuoka opened 6 years ago

putuoka commented 6 years ago

i have tried and look into your web base javascript MCTS (monte carlo tree search) it only use 100 loop/iteration to define AI next best move. so where is the tree search? from what i know MCTS is a tree search that use score to mark previous move base on win. If the previous move make an AI win it mark as high score move, otherwise it score as low. in my understanding MCTS need a database to record the move and mark it with score.

this make AI is improved every time it played. they called trainer. when the AI played 10000 times they will improved the move based on stored score.

mjcorriere commented 6 years ago

For my (admittedly) simple version of MCTS I am recreating the MCTS tree for every computer move. This implementation does not keep a history from game to game nor from move to move. If this is something you would like to add I'd love to see it.

As to where the tree search is occurring, you can find it in a combination of index.html (makeComputerMove()) and in mcts.js. Each computer turn creates a new root MCTS node from the current gamestate and then kicks off a search for the best move given a fixed number of iterations. The tree is built under this root node and discarded before the next computer turn. As I mentioned, there is no history saved.

putuoka commented 6 years ago

Thanks for replying. i have inspect your code on makeComputerMove() and i found out that you only place a random number to move if checkforwin function fail in mean human opponent not in 1 step to win so computer moved on random move. What my expectation is the computer AI play 100 times facing it self to find out what is the best next move. But i'll try to read it again might i made big mistake to understand