August 2018
Beginner
334 pages
10h 19m
English
We will implement the following steps in the same Bandit class we created before.
float initialRegret = 10f;float[] regret;float[] chance;RPSAction lastOpponentAction;RPSAction[] lastActionRM;
public void InitRegretMatching(){ if (init) return; // next steps}
numActions = System.Enum.GetNames(typeof(RPSAction)).Length;regret = new float[numActions];chance = new float[numActions];int i;for (i = 0; i < numActions; i++){ regret[i] = initialRegret; chance[i] = 0f;}init = true;
public RPSAction GetNextActionRM(){ // next ...Read now
Unlock full access