Runs one timestep of the environment's dynamics.
(self, state: State, action: jax.Array)
| 34 | return State(pipeline_state, obs, reward, done, {}) |
| 35 | |
| 36 | def step(self, state: State, action: jax.Array) -> State: |
| 37 | """Runs one timestep of the environment's dynamics.""" |
| 38 | pipeline_state0 = state.pipeline_state |
| 39 | assert pipeline_state0 is not None |
| 40 | pipeline_state = self.pipeline_step(pipeline_state0, action) |
| 41 | |
| 42 | obs = self._get_obs(pipeline_state) |
| 43 | reward = self._get_reward(pipeline_state) |
| 44 | |
| 45 | return state.replace( |
| 46 | pipeline_state=pipeline_state, obs=obs, reward=reward, done=0.0 |
| 47 | ) |
| 48 | |
| 49 | def _get_obs(self, pipeline_state: base.State) -> jax.Array: |
| 50 | """Returns the environment observations.""" |
nothing calls this directly
no test coverage detected