continual-foragax 0.12.0__py3-none-any.whl → 0.13.0__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.12.0
3
+ Version: 0.13.0
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
3
  foragax/env.py,sha256=EyT6KY0d0mXNh6yw10V-8SJVAdyPAGKtRdFV4wXq-JM,19836
4
- foragax/objects.py,sha256=_TO7tBFCzH5L3JwzHK4bPIh090mtlWBSXcPsZ4y0gHg,6745
5
- foragax/registry.py,sha256=CjD1eRlY5956royMUPLYuZ3twVcuI9pbRN9M0TEagmo,3437
4
+ foragax/objects.py,sha256=-XkuZVbbSTFNJ02f6HsH4GbxZ6YrUetiY39r9Zw4UWE,6967
5
+ foragax/registry.py,sha256=j2-KgcquYePklXMxpmDtGUdbjA6mvAO5XGNcwj0FByA,4486
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.12.0.dist-info/METADATA,sha256=yHZYcu0knPEtTUHbAcIGNx9EEqkZpCs_UT3TwAh6bOM,4897
132
- continual_foragax-0.12.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
133
- continual_foragax-0.12.0.dist-info/entry_points.txt,sha256=Qiu6iE_XudrDO_bVAMeA435h4PO9ourt8huvSHiuMPc,41
134
- continual_foragax-0.12.0.dist-info/top_level.txt,sha256=-z3SDK6RfLIcLI24n8rdbeFzlVY3hunChzlu-v1Fncs,8
135
- continual_foragax-0.12.0.dist-info/RECORD,,
131
+ continual_foragax-0.13.0.dist-info/METADATA,sha256=L_kwRE8vRK-qfcH5AyrS3U_Rz_LZqM3svgC7ojGA738,4897
132
+ continual_foragax-0.13.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
133
+ continual_foragax-0.13.0.dist-info/entry_points.txt,sha256=Qiu6iE_XudrDO_bVAMeA435h4PO9ourt8huvSHiuMPc,41
134
+ continual_foragax-0.13.0.dist-info/top_level.txt,sha256=-z3SDK6RfLIcLI24n8rdbeFzlVY3hunChzlu-v1Fncs,8
135
+ continual_foragax-0.13.0.dist-info/RECORD,,
foragax/objects.py CHANGED
@@ -214,7 +214,10 @@ GREEN_FAKE = DefaultForagaxObject(
214
214
 
215
215
 
216
216
  def create_weather_objects(
217
- file_index: int = 0, repeat: int = 500, multiplier: float = 1.0
217
+ file_index: int = 0,
218
+ repeat: int = 500,
219
+ multiplier: float = 1.0,
220
+ same_color: bool = False,
218
221
  ):
219
222
  """Create HOT and COLD WeatherObject instances using the specified file.
220
223
 
@@ -222,6 +225,7 @@ def create_weather_objects(
222
225
  file_index: Index into `FILE_PATHS` to select the temperature file.
223
226
  repeat: How many steps each temperature value repeats for.
224
227
  multiplier: Base multiplier applied to HOT; COLD will use -multiplier.
228
+ same_color: If True, both HOT and COLD use the same color.
225
229
 
226
230
  Returns:
227
231
  A tuple (HOT, COLD) of WeatherObject instances.
@@ -234,20 +238,23 @@ def create_weather_objects(
234
238
 
235
239
  rewards = load_data(FILE_PATHS[file_index])
236
240
 
241
+ hot_color = (63, 30, 25) if same_color else (255, 0, 255)
242
+
237
243
  hot = WeatherObject(
238
244
  name="hot",
239
245
  rewards=rewards,
240
246
  repeat=repeat,
241
247
  multiplier=multiplier,
242
- color=(255, 0, 255),
248
+ color=hot_color,
243
249
  )
244
250
 
251
+ cold_color = hot_color if same_color else (0, 255, 255)
245
252
  cold = WeatherObject(
246
253
  name="cold",
247
254
  rewards=rewards,
248
255
  repeat=repeat,
249
256
  multiplier=-multiplier,
250
- color=(0, 255, 255),
257
+ color=cold_color,
251
258
  )
252
259
 
253
260
  return hot, cold
foragax/registry.py CHANGED
@@ -31,6 +31,19 @@ ENV_CONFIGS: Dict[str, Dict[str, Any]] = {
31
31
  # Cold biome
32
32
  Biome(start=(0, 10), stop=(15, 12), object_frequencies=(0.0, 0.5)),
33
33
  ),
34
+ "nowrap": False,
35
+ },
36
+ "ForagaxWeather-v2": {
37
+ "size": (15, 15),
38
+ "aperture_size": None,
39
+ "objects": None,
40
+ "biomes": (
41
+ # Hot biome
42
+ Biome(start=(0, 3), stop=(15, 5), object_frequencies=(0.5, 0.0)),
43
+ # Cold biome
44
+ Biome(start=(0, 10), stop=(15, 12), object_frequencies=(0.0, 0.5)),
45
+ ),
46
+ "nowrap": True,
34
47
  },
35
48
  "ForagaxTwoBiome-v1": {
36
49
  "size": (15, 15),
@@ -44,6 +57,7 @@ ENV_CONFIGS: Dict[str, Dict[str, Any]] = {
44
57
  start=(10, 0), stop=(12, 15), object_frequencies=(0.0, 0.5, 0.0, 0.25)
45
58
  ),
46
59
  ),
60
+ "nowrap": False,
47
61
  },
48
62
  "ForagaxTwoBiomeSmall-v1": {
49
63
  "size": (16, 8),
@@ -55,6 +69,7 @@ ENV_CONFIGS: Dict[str, Dict[str, Any]] = {
55
69
  # Oyster biome
56
70
  Biome(start=(10, 2), stop=(14, 6), object_frequencies=(0.0, 1.0)),
57
71
  ),
72
+ "nowrap": False,
58
73
  },
59
74
  "ForagaxTwoBiomeSmall-v2": {
60
75
  "size": (16, 8),
@@ -66,6 +81,19 @@ ENV_CONFIGS: Dict[str, Dict[str, Any]] = {
66
81
  # Oyster biome
67
82
  Biome(start=(11, 3), stop=(14, 6), object_frequencies=(0.0, 1.0)),
68
83
  ),
84
+ "nowrap": False,
85
+ },
86
+ "ForagaxTwoBiomeSmall-v3": {
87
+ "size": (16, 8),
88
+ "aperture_size": None,
89
+ "objects": (MEDIUM_MOREL, LARGE_OYSTER),
90
+ "biomes": (
91
+ # Morel biome
92
+ Biome(start=(3, 3), stop=(6, 6), object_frequencies=(1.0, 0.0)),
93
+ # Oyster biome
94
+ Biome(start=(11, 3), stop=(14, 6), object_frequencies=(0.0, 1.0)),
95
+ ),
96
+ "nowrap": True,
69
97
  },
70
98
  }
71
99
 
@@ -75,7 +103,7 @@ def make(
75
103
  observation_type: str = "object",
76
104
  aperture_size: Optional[Tuple[int, int]] = (5, 5),
77
105
  file_index: int = 0,
78
- nowrap: bool = False,
106
+ nowrap: Optional[bool] = None,
79
107
  ) -> ForagaxEnv:
80
108
  """Create a Foragax environment.
81
109
 
@@ -84,8 +112,9 @@ def make(
84
112
  observation_type: The type of observation to use. One of "object", "rgb", or "world".
85
113
  aperture_size: The size of the agent's observation aperture. If None, the default
86
114
  for the environment is used.
87
- file_index: File index for weather objects.
88
- nowrap: If True, disables wrapping around environment boundaries.
115
+ file_index: File index for weather objects. nowrap: If True, disables
116
+ wrapping around environment boundaries. If None, uses defaults per
117
+ environment.
89
118
 
90
119
  Returns:
91
120
  A Foragax environment instance.
@@ -96,10 +125,12 @@ def make(
96
125
  config = ENV_CONFIGS[env_id].copy()
97
126
 
98
127
  config["aperture_size"] = aperture_size
99
- config["nowrap"] = nowrap
128
+ if nowrap is not None:
129
+ config["nowrap"] = nowrap
100
130
 
101
131
  if env_id.startswith("ForagaxWeather"):
102
- hot, cold = create_weather_objects(file_index=file_index)
132
+ same_color = env_id == "ForagaxWeather-v2"
133
+ hot, cold = create_weather_objects(file_index=file_index, same_color=same_color)
103
134
  config["objects"] = (hot, cold)
104
135
 
105
136
  env_class_map = {