There's more...

We need a function for handling the overall actions of the game and informing the algorithm of the actions from the opponent. In this case, the player's actions:

public void TellOpponentAction(RPSAction action){  totalActions++;  float utility;  utility = GetUtility(lastAction, action);  score[(int)lastAction] += utility;  count[(int)lastAction] += 1;}

Get Unity 2018 Artificial Intelligence Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.