August 2018
Beginner
334 pages
10h 19m
English
Not only it is important to define and balance strategies, but also the results of keeping track of the opponent's actions. That's why we need to implement a member function for adding them into the mix we talked about in the previous section:
public void TellOpponentActionRM(RPSAction action){ lastOpponentAction = action; int i; for (i = 0; i < numActions; i++) { regret[i] += GetUtility((RPSAction)lastActionRM[i], (RPSAction)action); regret[i] -= GetUtility((RPSAction)lastAction, (RPSAction) action); }}
Finally, it's important to balance the strategies and the utility function. It's pretty straightforward for RPS, but it could get as complex as our game.
Read now
Unlock full access