parabellum 0.2.21__py3-none-any.whl → 0.2.23__py3-none-any.whl

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/env.py CHANGED
@@ -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
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: parabellum
3
- Version: 0.2.21
3
+ Version: 0.2.23
4
4
  Summary: Parabellum environment for parallel warfare simulation
5
5
  Home-page: https://github.com/syrkis/parabellum
6
6
  License: MIT
@@ -1,10 +1,10 @@
1
1
  parabellum/__init__.py,sha256=-5cWXJkHnfH_CbhTEall8Wak8McAFXZHP1L8Fu7Uo5k,373
2
2
  parabellum/aid.py,sha256=HWST27inTFXcp8b11izJF0U7N7DZnRTIS3n1Qfa-Ko4,106
3
- parabellum/env.py,sha256=L6GHlLxywpkV1bRnZcYBURREPP4CRfet_pEwCt5DB04,16724
3
+ parabellum/env.py,sha256=2IuXipHXUJAyfrjPtDW7uINb8mY4G3-xQ_lhReMGqLs,16985
4
4
  parabellum/gun.py,sha256=nvsJdcZ2Qd6lbPlAgsUiaLhstTi1UdLQ8kOnbCenucY,2618
5
5
  parabellum/map.py,sha256=EUcPe4Upu9MQzS8h15IVPGCaAyRPLSkmoLd5ZT-V4Pk,2599
6
6
  parabellum/run.py,sha256=EO_F7VPwayatpSHrcbSahtinsV4QObhcx0jo-4KZO1E,3472
7
7
  parabellum/vis.py,sha256=uXTnhJL23JLQHW9by-M4bF73dSVA5TIkpNdfo_Go2Ro,6045
8
- parabellum-0.2.21.dist-info/METADATA,sha256=-K-3eYl1BvR3tFsiTxTyfHErQJdgPQZx08iq_kS2544,2671
9
- parabellum-0.2.21.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
10
- parabellum-0.2.21.dist-info/RECORD,,
8
+ parabellum-0.2.23.dist-info/METADATA,sha256=qwEcFJksQ54_MNpMj8Zq1EC2qDgltEC9u9ivZFxZ0Eg,2671
9
+ parabellum-0.2.23.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
10
+ parabellum-0.2.23.dist-info/RECORD,,