Runs one timestep of the environment's dynamics.
(self, state: State, action: jax.Array)
| 32 | return State(pipeline_state, obs, reward, done, {}) |
| 33 | |
| 34 | def step(self, state: State, action: jax.Array) -> State: |
| 35 | """Runs one timestep of the environment's dynamics.""" |
| 36 | pipeline_state = self.pipeline_step(state.pipeline_state, action) |
| 37 | |
| 38 | obs = self._get_obs(pipeline_state, action) |
| 39 | reward = self._get_reward(pipeline_state) |
| 40 | |
| 41 | return state.replace(pipeline_state=pipeline_state, obs=obs, reward=reward) |
| 42 | |
| 43 | def _get_obs(self, pipeline_state: base.State, action: jax.Array) -> jax.Array: |
| 44 | return jnp.concatenate([pipeline_state.q, pipeline_state.qd], axis=-1) |
nothing calls this directly
no test coverage detected