def init_action(self)""the initial action act randomly initially could be overridden (but ' not sure why you would""self act random choice(self actionsself dist[self act+ return self act def select_action(selfreward)""select the action given the reward this implements "act randomlyand should be overridden""self total_score +reward self act random choice(self actionsself dist[self act+ return self act maslearn py -(continued class simpleqagent(gameagent)"""this agent just counts the number of times (it thinksit has won and does the actions it thinks is most likely to win ""def __init__(selfactionsalpha= q_init= explore= )""actions is the set of actions the agent can do alpha is the step size q_init is the initial -values explore is the probability of an exporatory (randomaction ""gameagent __init__(selfactionsself { :q_init for in self actionsself dist {act: for act in actionsunnormalized distibution self num_steps self alpha alpha self explore explore def select_action(selfreward)self total_score +reward self num_steps + self display( , "the reward for agent {self idwas {reward}"self [self act+self alpha*(reward-self [self act]if random random(self exploreself act random choice(self actionsact randomly elseself act utilities argmaxd(self qself dist[self act+ version june