@@ -0,0 +1,994 @@
+# -*- coding: utf-8 -*-%0A%0Aimport matplotlib.pyplot as plt%0Aimport numpy as np%0Aimport time%0A%0Aimport universe%0A%0A%0Aseed = 91231%0An_trials = 5%0An_steps = 3500%0A%0Asteps_to_reward = 9%0Amax_reward = n_steps / steps_to_reward%0A%0A# uni = universe.Universe('grid_world', world='world0')%0Auni = universe.Universe('grid_world', world='2d_world0')%0Auni.show()%0A%0Afig = plt.figure()%0Aax = fig.add_axes(%5B0.1, 0.1, 0.8, 0.8%5D)%0Aax.set_xlim(%5B0, uni._env._shape%5B1%5D%5D)%0Aax.set_ylim(%5B0, uni._env._shape%5B0%5D%5D)%0Aax_value = fig.add_axes(%5B0.1, 0.1, .8, .8%5D,%0A                        frameon=False, xticks=%5B%5D, yticks=%5B%5D)%0Aax_value.set_xlim(%5B0, uni._env._shape%5B1%5D%5D)%0Aax_value.set_ylim(%5B0, uni._env._shape%5B0%5D%5D)%0A%0Aplt.ion()%0Aplt.show()%0A%0Auni.plot_env(ax)%0A%0Anp.random.seed(seed)%0A%0Alast_reward = 0.%0Afor _ in range(n_steps):%0A    uni.step()%0A    uni.plot_agent(ax)%0A    if uni.total_agent_reward() != last_reward:%0A        uni.plot_value(ax_value)%0A        last_reward = uni.total_agent_reward()%0A    plt.pause(0.010)%0A%0Aprint('reward:', uni.total_agent_reward())%0A

Add simulation with visualization