1 of 4

This week’s short assignments

2 of 4

Step 3: Simulation�

Implement the simulation step of the MCTS algorithm

When should the simulation stop?

From which player’s point of view should you evaluate its results?

Don’t forget to bound the number of steps in a simulation using the playoutDepthLimit value in the settings variable.

When performing simulations, first clone the state in the node using the Board.GetLightWeightClone method and use the lightweight clone.

When evaluating states, use rewards 0 = loss, 1 = win, Evaluation.EvaluateSimBoard() for anything else. (Alternatively, you can use different rewards if you find it easier, but you need to adjust UCB accordingly in order to achieve the same results.)

3 of 4

Step 3: Simulation�

As the lightweight clone of the current state is just a 2D array, it has no special methods, so there is no method for applying moves to it. However, as doing so just requires changing the position of one piece according to the data in a SimMove object, I thought I could leave this for you to implement where you see fit.

A simulation ends either when it exceeds maximum simulation length, or when one of the kings is captured (again, no method for checking this, for the same reason).

4 of 4

Step 4: Backpropagation�

Implement the backpropagation step of the MCTS algorithm

You’ve already decided what data should be stored in the nodes – now think about how to update it in every iteration.

Write your implementation so that it compiles.

Send your solutions to me (via Discord or mail).

Deadline: 06.01.2025 23:59 (the evening before the next lecture)