# -*- coding: utf-8 -*-

import numpy as np

import universe


seed = 91231
n_trials = 20
n_steps = 1000

steps_to_reward = 9
max_reward = n_steps // steps_to_reward * 5.

uni = universe.Universe('grid_world', world='2d_world0')
uni.show()

reward = []
for i in range(n_trials):
    np.random.seed(1234 + i)

    uni.reset_agent_position()
    uni.reset_agent_reward()
    for _ in range(n_steps):
        uni.step()

    reward.append(uni._agent._total_reward)
    print('total reward after {steps} steps: {reward}/{max_reward}'.format(steps=n_steps, reward=uni._agent._total_reward, max_reward=max_reward))

@@ -18,16 +18,48 @@
 -8 -*-%0A%0A
+import matplotlib.pyplot as plt%0A
 import n
@@ -69,16 +69,16 @@
 y as np%0A
-
 %0Aimport 
@@ -149,17 +149,18 @@
 eward = 
-9
+14
 %0Amax_rew
@@ -251,17 +251,17 @@
 2d_world
-0
+1
 ')%0Auni.s
@@ -301,24 +301,46 @@
 (n_trials):%0A
+    reward_trial = %5B%5D%0A
     np.rando
@@ -466,16 +466,20 @@
 step()%0A%0A
+    
     rewa
@@ -480,16 +480,22 @@
   reward
+_trial
 .append(
@@ -520,16 +520,48 @@
 reward)%0A
+    reward.append(reward_trial)%0A
     prin
@@ -699,8 +699,71 @@
 eward))%0A
+%0A%0Afor i in range(n_trials):%0A    plt.plot(reward%5Bi%5D)%0Aplt.show()%0A

Add trial cumulative reward plot