reinforcement learning self discount discount self explore explore self fixed_alpha fixed_alpha self alpha alpha self alpha_fun alpha_fun self qinit qinit self label label self restart(restart is used to make the learner relearn everything this is used by the plotter to create new plots rlqlearner py -(continued def restart(self)"""make the agent relearnand reset the accumulated rewards ""self acc_rewards self state self env state self {self visits {do takes in the number of steps rlqlearner py -(continued def do(self,num_steps= )"""do num_steps of interaction with the environment""self display( ," \ta\tr\ts'\tq"alpha self alpha for in range(num_steps)action self select_action(self statenext_state,reward self env do(actionif not self fixed_alphak self visits[(self stateaction)self visits get((self stateaction), )+ alpha self alpha_fun(kself [(self stateaction)( -alphaself get((self stateaction),self qinitalpha (reward self discount max(self get((next_statenext_act),self qinitfor next_act in self actions))self display( ,self stateactionrewardnext_stateself [(self stateaction)]sep='\ 'self state next_state self acc_rewards +reward select action us used to select the next action to perform this can be reimplemented to give different exploration strategy rlqlearner py -(continued def select_action(selfstate)"""returns an action to carry out for the current agent version june