parabellum 0.2.21__tar.gz → 0.2.23__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {parabellum-0.2.21 → parabellum-0.2.23}/PKG-INFO +1 -1
- {parabellum-0.2.21 → parabellum-0.2.23}/parabellum/env.py +8 -1
- {parabellum-0.2.21 → parabellum-0.2.23}/pyproject.toml +1 -1
- {parabellum-0.2.21 → parabellum-0.2.23}/README.md +0 -0
- {parabellum-0.2.21 → parabellum-0.2.23}/parabellum/__init__.py +0 -0
- {parabellum-0.2.21 → parabellum-0.2.23}/parabellum/aid.py +0 -0
- {parabellum-0.2.21 → parabellum-0.2.23}/parabellum/gun.py +0 -0
- {parabellum-0.2.21 → parabellum-0.2.23}/parabellum/map.py +0 -0
- {parabellum-0.2.21 → parabellum-0.2.23}/parabellum/run.py +0 -0
- {parabellum-0.2.21 → parabellum-0.2.23}/parabellum/vis.py +0 -0
@@ -97,6 +97,7 @@ class Environment(SMAX):
|
|
97
97
|
self.top_sector, self.top_sector_offset = sector_fn(self.terrain_raster, 0)
|
98
98
|
self.low_sector, self.low_sector_offset = sector_fn(self.terrain_raster, 24)
|
99
99
|
|
100
|
+
|
100
101
|
@partial(jax.jit, static_argnums=(0,))
|
101
102
|
def reset(self, rng: chex.PRNGKey) -> Tuple[Dict[str, chex.Array], State]:
|
102
103
|
"""Environment-specific reset."""
|
@@ -125,9 +126,15 @@ class Environment(SMAX):
|
|
125
126
|
state = self._push_units_away(state) # type: ignore
|
126
127
|
obs = self.get_obs(state)
|
127
128
|
world_state = self.get_world_state(state)
|
128
|
-
obs["world_state"] = jax.lax.stop_gradient(world_state)
|
129
|
+
# obs["world_state"] = jax.lax.stop_gradient(world_state)
|
129
130
|
return obs, state
|
130
131
|
|
132
|
+
def step_env(self, rng, state: State, action: Array):
|
133
|
+
obs, state, rewards, dones, infos = super().step_env(rng, state, action)
|
134
|
+
# delete world_state from obs
|
135
|
+
obs.pop("world_state")
|
136
|
+
return obs, state, rewards, dones, infos
|
137
|
+
|
131
138
|
def _our_push_units_away(
|
132
139
|
self, pos, unit_types, firmness: float = 1.0
|
133
140
|
): # copy of SMAX._push_units_away but used without state and called inside _world_step to allow more obstacles constraints
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|