continual-foragax 0.12.0__py3-none-any.whl → 0.14.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.14.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=-Vj8fXlW8xbpCM6ZhEp0hc3EIGBUqP7tIaI2dwWv7RE,4972
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.14.0.dist-info/METADATA,sha256=8IVQW9CR42G8PrAfd5oi4hCLLAULf5JUSNaAkYNS14k,4897
132
+ continual_foragax-0.14.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
133
+ continual_foragax-0.14.0.dist-info/entry_points.txt,sha256=Qiu6iE_XudrDO_bVAMeA435h4PO9ourt8huvSHiuMPc,41
134
+ continual_foragax-0.14.0.dist-info/top_level.txt,sha256=-z3SDK6RfLIcLI24n8rdbeFzlVY3hunChzlu-v1Fncs,8
135
+ continual_foragax-0.14.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,21 @@ 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,
61
+ },
62
+ "ForagaxTwoBiome-v2": {
63
+ "size": (15, 15),
64
+ "aperture_size": None,
65
+ "objects": (BROWN_MOREL, BROWN_OYSTER, GREEN_DEATHCAP, GREEN_FAKE),
66
+ "biomes": (
67
+ # Morel biome
68
+ Biome(start=(3, 0), stop=(5, 15), object_frequencies=(0.5, 0.0, 0.25, 0.0)),
69
+ # Oyster biome
70
+ Biome(
71
+ start=(10, 0), stop=(12, 15), object_frequencies=(0.0, 0.5, 0.0, 0.25)
72
+ ),
73
+ ),
74
+ "nowrap": True,
47
75
  },
48
76
  "ForagaxTwoBiomeSmall-v1": {
49
77
  "size": (16, 8),
@@ -55,6 +83,7 @@ ENV_CONFIGS: Dict[str, Dict[str, Any]] = {
55
83
  # Oyster biome
56
84
  Biome(start=(10, 2), stop=(14, 6), object_frequencies=(0.0, 1.0)),
57
85
  ),
86
+ "nowrap": False,
58
87
  },
59
88
  "ForagaxTwoBiomeSmall-v2": {
60
89
  "size": (16, 8),
@@ -66,6 +95,19 @@ ENV_CONFIGS: Dict[str, Dict[str, Any]] = {
66
95
  # Oyster biome
67
96
  Biome(start=(11, 3), stop=(14, 6), object_frequencies=(0.0, 1.0)),
68
97
  ),
98
+ "nowrap": False,
99
+ },
100
+ "ForagaxTwoBiomeSmall-v3": {
101
+ "size": (16, 8),
102
+ "aperture_size": None,
103
+ "objects": (MEDIUM_MOREL, LARGE_OYSTER),
104
+ "biomes": (
105
+ # Morel biome
106
+ Biome(start=(3, 3), stop=(6, 6), object_frequencies=(1.0, 0.0)),
107
+ # Oyster biome
108
+ Biome(start=(11, 3), stop=(14, 6), object_frequencies=(0.0, 1.0)),
109
+ ),
110
+ "nowrap": True,
69
111
  },
70
112
  }
71
113
 
@@ -75,7 +117,7 @@ def make(
75
117
  observation_type: str = "object",
76
118
  aperture_size: Optional[Tuple[int, int]] = (5, 5),
77
119
  file_index: int = 0,
78
- nowrap: bool = False,
120
+ nowrap: Optional[bool] = None,
79
121
  ) -> ForagaxEnv:
80
122
  """Create a Foragax environment.
81
123
 
@@ -84,8 +126,9 @@ def make(
84
126
  observation_type: The type of observation to use. One of "object", "rgb", or "world".
85
127
  aperture_size: The size of the agent's observation aperture. If None, the default
86
128
  for the environment is used.
87
- file_index: File index for weather objects.
88
- nowrap: If True, disables wrapping around environment boundaries.
129
+ file_index: File index for weather objects. nowrap: If True, disables
130
+ wrapping around environment boundaries. If None, uses defaults per
131
+ environment.
89
132
 
90
133
  Returns:
91
134
  A Foragax environment instance.
@@ -96,10 +139,12 @@ def make(
96
139
  config = ENV_CONFIGS[env_id].copy()
97
140
 
98
141
  config["aperture_size"] = aperture_size
99
- config["nowrap"] = nowrap
142
+ if nowrap is not None:
143
+ config["nowrap"] = nowrap
100
144
 
101
145
  if env_id.startswith("ForagaxWeather"):
102
- hot, cold = create_weather_objects(file_index=file_index)
146
+ same_color = env_id == "ForagaxWeather-v2"
147
+ hot, cold = create_weather_objects(file_index=file_index, same_color=same_color)
103
148
  config["objects"] = (hot, cold)
104
149
 
105
150
  env_class_map = {