self get_features get_features self actions env actions self discount discount self explore explore self step_size step_size self winit winit self label label self restart(restart(is used to make the learner relearn everything this is used by the plotter to create new plots rlfeatures py -(continued def restart(self)"""make the agent relearnand reset the accumulated rewards ""self acc_rewards self state self env state self features self get_features(self statelist(self env actions)[ ]self weights [self winit for in self featuresself action self select_action(self statedo takes in the number of steps rlfeatures py -(continued def do(self,num_steps= )"""do num_steps of interaction with the environment""self display( ," \ta\tr\ts'\tq\tdelta"for in range(num_steps)next_state,reward self env do(self actionself acc_rewards +reward next_action self select_action(next_statefeature_values self get_features(self state,self actionoldq dot_product(self weightsfeature_valuesnextq dot_product(self weightsself get_features(next_state,next_action)delta reward self discount nextq oldq for in range(len(self weights))self weights[ +self step_size delta feature_values[iself display( ,self stateself actionrewardnext_statedot_product(self weightsfeature_values)deltasep='\ 'self state next_state self action next_action def select_action(selfstate)"""returns an action to carry out for the current agent given the stateand the -function this implements an epsilon-greedy approach where self explore is the probability of exploring ""version june