Skip to content

Commit

Permalink
add rng to env step
Browse files Browse the repository at this point in the history
  • Loading branch information
syrkis committed Aug 7, 2024
1 parent 74a28f5 commit 5b95660
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions parabellum/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,14 +126,9 @@ def reset(self, rng: chex.PRNGKey) -> Tuple[Dict[str, chex.Array], State]:
state = self._push_units_away(state) # type: ignore
obs = self.get_obs(state)
world_state = self.get_world_state(state)
# obs["world_state"] = jax.lax.stop_gradient(world_state)
obs["world_state"] = jax.lax.stop_gradient(world_state)
return obs, state

def step_env(self, rng, state: State, action: Array):
obs, state, rewards, dones, infos = super().step_env(rng, state, action)
# delete world_state from obs
obs.pop("world_state")
return obs, state, rewards, dones, infos

def _our_push_units_away(
self, pos, unit_types, firmness: float = 1.0
Expand Down

0 comments on commit 5b95660

Please sign in to comment.