Skip to content
Snippets Groups Projects
Commit 032741df authored by Matteo Rossi's avatar Matteo Rossi
Browse files

Added a simple benchmark script

parent d412f391
No related branches found
No related tags found
No related merge requests found
......@@ -2,11 +2,15 @@ import gym
import gym_stirap
import numpy as np
import time
env = gym.make('stirap-v0')
reward = np.zeros(env.timesteps)
env.reset()
tic = time.process_time()
for t in range(env.timesteps):
env.render()
# Perform a random action
action = env.action_space.sample()
......@@ -16,4 +20,6 @@ for t in range(env.timesteps):
print("Episode finished after {} timesteps".format(t+1))
break
toc = time.process_time()
print("Score: ", np.sum(reward))
print("Elapsed time: {} s".format(toc - tic))
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment