Replay episodes forever using the supplied action picker (single env).
(env, get_action)
| 226 | |
| 227 | |
| 228 | def run_test_loop(env, get_action): |
| 229 | """Replay episodes forever using the supplied action picker (single env).""" |
| 230 | while True: |
| 231 | obs, _ = env.reset() |
| 232 | done = False |
| 233 | score = 0.0 |
| 234 | while not done: |
| 235 | quit_if_window_closed(env) |
| 236 | action = get_action(np.asarray(obs)) |
| 237 | obs, reward, terminated, truncated, _ = env.step(action) |
| 238 | done = terminated or truncated |
| 239 | score += reward |
| 240 | print(f"test score: {score}") |
nothing calls this directly
no test coverage detected