elseself +- elif actual_direction ="up"if self ==self ydim- reward +self crashed_reward elseself + elif actual_direction ="down"if self == reward +self crashed_reward elseself +- elseraise runtimeerror("unknown_direction "+str(direction) monsters if (self ,self yin self monster_locs and flip(self monster_appears_prob)if self damagedreward +self monster_reward_when_damaged elseself damaged true if (self ,self yin self repair_stationsself damaged false prizes if (self ,self =self prizereward +self prize_reward self prize none statistics self number_steps + self total_reward +reward if self total_reward self min_rewardself min_reward self total_reward self min_step self number_steps if self total_reward> and reward>self total_rewardself zero_crossing self number_steps self display( ,"",self number_steps,self total_rewardself total_reward/self number_steps,sep="\ " return (self xself yself damagedself prize)reward evaluation and plotting rlplot py -rl plotter import matplotlib pyplot as plt def plot_rl(aglabel=noneyplot='total'step_size=noneversion june