10 Commits

Author SHA1 Message Date
76051cd76b Removing the id field from the Action trait
This would in theory be useful for a transposition table, but we do not
currently support that. As such I don't want to burden the
implementation with that field until it is deemed necessary.
2025-06-30 21:41:27 -07:00
a7102a0e44 Fixed missing non terminal error 2025-06-30 20:08:18 -07:00
854772a63d Improve UCB1-Tuned performance
We calculate the sample variance of the rewards online storing the value
in the node. This greatly reduces the amount of summations that need to
be done to calculate the variance during the selection phase.

While this burdens other selection algorithms, the cost is not
substantial.
2025-06-29 18:43:52 -07:00
6a33818238 We propagate the reward for both sides
The AI now properly choses the optimal path for the active player
2025-06-27 16:12:40 -07:00
0f9d4f0c4e Use Entry::or_default 2025-06-27 15:40:58 -07:00
9f893b0005 Upgrade rand to ~0.9 2025-06-27 15:17:45 -07:00
b80f039b93 Adding a basic print_tree function to visualize the MCTS search tree
This probably is not a good thing to run on a very large tree.
2025-06-27 15:00:43 -07:00
6cc6e6a7ba WeightedBackfillPropagation is implemented 2025-06-27 14:06:19 -07:00
37b1f56f74 Typo fix, the node is not mutable 2025-06-27 13:55:01 -07:00
17884f4b90 Working MCTS implementation
This is a basic working implementation of the MCTS algorithm. Though
currently the algorithm is slow compared with other implemenations, and
makes sub-optimal choices when playing tic-tac-toe. Therefore some
modifications are needed
2025-06-27 13:34:49 -07:00