continual-foragax 0.19.0__py3-none-any.whl → 0.20.1__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: continual-foragax
3
- Version: 0.19.0
3
+ Version: 0.20.1
4
4
  Summary: A continual reinforcement learning benchmark
5
5
  Author-email: Steven Tang <stang5@ualberta.ca>
6
6
  Requires-Python: >=3.8
@@ -1,8 +1,8 @@
1
1
  foragax/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
2
  foragax/colors.py,sha256=rqNPiywP4Nvr0POhsGpasRk-nMMTS3DOwFRUgperlUk,2065
3
- foragax/env.py,sha256=APPu0r31A9SlvmJYkoZzsrh59YFVoLW3Rmyb3JT-dHw,20613
3
+ foragax/env.py,sha256=phGPMzwNKbwLLIyme1bjca3l2MLNKfYYBmly7JP8cLc,20498
4
4
  foragax/objects.py,sha256=iDFo_2CjpgErAm3QdQt5ixmQ8jdIvl7siIPqzGwVcGk,7665
5
- foragax/registry.py,sha256=DbOCKcoE9bfLEAVxq4ts1MasYYdcQZVxCK_WuQvCVlc,7781
5
+ foragax/registry.py,sha256=5Ik61gIzTHc5A1_aOVbRXbVooRXz3GjmL7KdGsZTOTE,8642
6
6
  foragax/rendering.py,sha256=bms7wvBZTofoR-K-2QD2Ggeed7Viw8uwAEiEpEM3eSo,2768
7
7
  foragax/weather.py,sha256=KNAiwuFz8V__6G75vZIWQKPocLzXqxXn-Vt4TbHIpcA,1258
8
8
  foragax/data/ECA_non-blended_custom/TG_SOUID100897.txt,sha256=N7URbX6VlCZvCboUogYjMzy1I-0cfNPOn0QTLSHHfQ0,1776751
@@ -128,8 +128,8 @@ foragax/data/ECA_non-blended_custom/TG_SOUID156887.txt,sha256=juzTPgJoJxfqmZkorL
128
128
  foragax/data/ECA_non-blended_custom/elements.txt,sha256=OtcUBoDAHxuln79BPKGu0tsQxG_5G2BfAX3Ck130kEA,4507
129
129
  foragax/data/ECA_non-blended_custom/metadata.txt,sha256=nudnmOCy5cPJfSXt_IjyX0S5-T7NkCZREICZSimqeqc,48260
130
130
  foragax/data/ECA_non-blended_custom/sources.txt,sha256=1j3lSmINAoCMqPqFrHfZJriOz6sTYZNOhXzUwvTLas0,20857
131
- continual_foragax-0.19.0.dist-info/METADATA,sha256=y9A7sTHfOB84ycKWis5RsA9qkhyIpRdNw9t0fbuA8eo,4897
132
- continual_foragax-0.19.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
133
- continual_foragax-0.19.0.dist-info/entry_points.txt,sha256=Qiu6iE_XudrDO_bVAMeA435h4PO9ourt8huvSHiuMPc,41
134
- continual_foragax-0.19.0.dist-info/top_level.txt,sha256=-z3SDK6RfLIcLI24n8rdbeFzlVY3hunChzlu-v1Fncs,8
135
- continual_foragax-0.19.0.dist-info/RECORD,,
131
+ continual_foragax-0.20.1.dist-info/METADATA,sha256=UlkWfKTFOp5OPzmJ6ojc9I1aEtqCngdhNFcnX-WZ7gQ,4897
132
+ continual_foragax-0.20.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
133
+ continual_foragax-0.20.1.dist-info/entry_points.txt,sha256=Qiu6iE_XudrDO_bVAMeA435h4PO9ourt8huvSHiuMPc,41
134
+ continual_foragax-0.20.1.dist-info/top_level.txt,sha256=-z3SDK6RfLIcLI24n8rdbeFzlVY3hunChzlu-v1Fncs,8
135
+ continual_foragax-0.20.1.dist-info/RECORD,,
foragax/env.py CHANGED
@@ -361,19 +361,13 @@ class ForagaxEnv(environment.Environment):
361
361
  if self.nowrap:
362
362
  y_coords = jnp.clip(y_coords_original, 0, self.size[1] - 1)
363
363
  x_coords = jnp.clip(x_coords_original, 0, self.size[0] - 1)
364
- in_bounds = (
365
- (y_coords_original >= 0)
366
- & (y_coords_original < self.size[1])
367
- & (x_coords_original >= 0)
368
- & (x_coords_original < self.size[0])
369
- )
370
- original_colors = img[y_coords, x_coords]
364
+ # Create tint mask: any in-bounds original position maps to a cell makes it tinted
365
+ tint_mask = jnp.zeros((self.size[1], self.size[0]), dtype=int)
366
+ tint_mask = tint_mask.at[y_coords, x_coords].set(1)
367
+ # Apply tint to masked positions
368
+ original_colors = img
371
369
  tinted_colors = (1 - alpha) * original_colors + alpha * agent_color
372
- img = img.at[y_coords, x_coords].set(
373
- jnp.where(
374
- in_bounds[..., None], tinted_colors, img[y_coords, x_coords]
375
- )
376
- )
370
+ img = jnp.where(tint_mask[..., None], tinted_colors, img)
377
371
  else:
378
372
  y_coords = jnp.mod(y_coords_original, self.size[1])
379
373
  x_coords = jnp.mod(x_coords_original, self.size[0])
foragax/registry.py CHANGED
@@ -49,6 +49,13 @@ ENV_CONFIGS: Dict[str, Dict[str, Any]] = {
49
49
  ),
50
50
  "nowrap": True,
51
51
  },
52
+ "ForagaxWeather-v3": {
53
+ "size": None,
54
+ "aperture_size": None,
55
+ "objects": None,
56
+ "biomes": None,
57
+ "nowrap": True,
58
+ },
52
59
  "ForagaxTwoBiome-v1": {
53
60
  "size": (15, 15),
54
61
  "aperture_size": None,
@@ -216,13 +223,40 @@ def make(
216
223
  config["size"] = (width, 15)
217
224
  config["biomes"] = (
218
225
  # Morel biome
219
- Biome(start=(margin, 0), stop=(margin + 2, 15), object_frequencies=(0.25, 0.0, 0.5, 0.0)),
226
+ Biome(
227
+ start=(margin, 0),
228
+ stop=(margin + 2, 15),
229
+ object_frequencies=(0.25, 0.0, 0.5, 0.0),
230
+ ),
220
231
  # Oyster biome
221
- Biome(start=(margin + 7, 0), stop=(margin + 9, 15), object_frequencies=(0.0, 0.25, 0.0, 0.5)),
232
+ Biome(
233
+ start=(margin + 7, 0),
234
+ stop=(margin + 9, 15),
235
+ object_frequencies=(0.0, 0.25, 0.0, 0.5),
236
+ ),
237
+ )
238
+
239
+ if env_id == "ForagaxWeather-v3":
240
+ margin = aperture_size[1] // 2 + 1
241
+ width = 2 * margin + 9
242
+ config["size"] = (15, width)
243
+ config["biomes"] = (
244
+ # Hot biome
245
+ Biome(
246
+ start=(0, margin),
247
+ stop=(15, margin + 2),
248
+ object_frequencies=(0.5, 0.0),
249
+ ),
250
+ # Cold biome
251
+ Biome(
252
+ start=(0, margin + 7),
253
+ stop=(15, margin + 9),
254
+ object_frequencies=(0.0, 0.5),
255
+ ),
222
256
  )
223
257
 
224
258
  if env_id.startswith("ForagaxWeather"):
225
- same_color = env_id == "ForagaxWeather-v2"
259
+ same_color = env_id in ("ForagaxWeather-v2", "ForagaxWeather-v3")
226
260
  hot, cold = create_weather_objects(file_index=file_index, same_color=same_color)
227
261
  config["objects"] = (hot, cold)
228
262