You are browsing as a guest. Sign up (or log in) to start making projects!

1h 28m 41s logged

I haven’t worked on Versi for a little while, but today I wrote some traits outlining what my game representation needs to be able to do in order for the search algorithm to find good moves. For those unfamiliar with Rust, traits are a bit like interfaces in Java- they define what a type needs to be able to do rather than how to do it. As I mentioned in the first devlog, I want the MCTS code to be very extensible, so rather than assuming the data types I’m working with apply strictly to Reversi, I can simply indicate what information I do need, regardless of the game. If I every want to apply my MCTS code to, say, chess, I can simply implement the methods required by the trait bounds and pass the game representation into the search algorithm, and it will just work. Here’s an example of one of the traits I’ve defined - SearchGame. SearchGame indicates that any state space searchable by my implementation must provide it with a set of possible actions, a way of mapping actions to new states, a way of detecting whether a state is terminal (end of the game), and a way of determining who won in that terminal state.

0
5

Comments 0

No comments yet. Be the first!