Can we get observations before the first step?

It seems to me all the provided examples get the observations as the result of calling the step function on the environment. However, that means an agent needs to first make an action before getting observations for the first time.

Is it allowed to get observations before calling step the first time? (in order to plan some actions from the very beginning) Without this the agent doesn’t know anything about its location/environment when choosing its first action, which seems suboptimal to me.

Locally I could achieve this by explicitly calling _get_observations() from rail_env. I was wondering if that’s allowed or not (because I couldn’t find this behavior in any example - or maybe I didn’t look carefully enough).

1 Like

@mugurelionut: Sorry if the examples are a bit misleading. We will try to make the examples consistent.

But when you do the env.reset() call, it should return you an observation. So basically :

first_observation = env.reset()