def step(hparams, agent, state, env, worker_id):
  """ run envrionment for one step and return the output """
  if hparams.render:
    env.render()

  action = agent.act(state, worker_id)
  state, reward, done, _ = env.step(action)

  if done:
    state = env.reset()

  return action, reward, done, state