(game_cls, steps=10000)
| 14 | game.step(game.action_space.sample()) |
| 15 | |
| 16 | def performance_test(game_cls, steps=10000): |
| 17 | game = game_cls() |
| 18 | game.reset() |
| 19 | |
| 20 | for _ in range(1000): |
| 21 | game.step(0)#game.action_space.sample()) |
| 22 | |
| 23 | start = time.time() |
| 24 | for _ in range(steps): |
| 25 | game.step(0)#game.action_space.sample()) |
| 26 | |
| 27 | game.close() |
| 28 | end = time.time() |
| 29 | print('Steps per second: {}'.format(steps / (end - start))) |
| 30 | |
| 31 | if __name__ == '__main__': |
| 32 | performance_test(PokemonRed) |