August 2018
Beginner
334 pages
10h 19m
English
We will implement a Bandit class for building the logic behind the algorithm:
using UnityEngine;public class Bandit : MonoBehaviour{ // next steps}
bool init;int totalActions;int[] count;float[] score;int numActions;RPSAction lastAction;int lastStrategy;
public void InitUCB1(){ if (init) return; // next step}
totalActions = 0; numActions = System.Enum.GetNames(typeof(RPSAction)).Length; count = new int[numActions]; score = new float[numActions]; int i; for (i = 0; i < numActions; i++) { count[i] = 0; score[i] = 0f; } init = true;
Read now
Unlock full access