continual-foragax 0.34.0__py3-none-any.whl → 0.36.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.
- {continual_foragax-0.34.0.dist-info → continual_foragax-0.36.0.dist-info}/METADATA +1 -1
- {continual_foragax-0.34.0.dist-info → continual_foragax-0.36.0.dist-info}/RECORD +8 -8
- foragax/env.py +10 -5
- foragax/objects.py +9 -1
- foragax/registry.py +36 -0
- {continual_foragax-0.34.0.dist-info → continual_foragax-0.36.0.dist-info}/WHEEL +0 -0
- {continual_foragax-0.34.0.dist-info → continual_foragax-0.36.0.dist-info}/entry_points.txt +0 -0
- {continual_foragax-0.34.0.dist-info → continual_foragax-0.36.0.dist-info}/top_level.txt +0 -0
|
@@ -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=
|
|
4
|
-
foragax/objects.py,sha256=
|
|
5
|
-
foragax/registry.py,sha256=
|
|
3
|
+
foragax/env.py,sha256=K3noPwdYmQlnXVjslqVzX_FIB-CnOh37mWFArQXnf_Y,66324
|
|
4
|
+
foragax/objects.py,sha256=PPuLYjD7em7GL404eSpP6q8TxF8p7JtQ1kIwh7uD_tU,26860
|
|
5
|
+
foragax/registry.py,sha256=y_MEvM0K_E4fzdp4XokzLh1D94UAuCu16wGwJV4wa_A,19289
|
|
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.
|
|
132
|
-
continual_foragax-0.
|
|
133
|
-
continual_foragax-0.
|
|
134
|
-
continual_foragax-0.
|
|
135
|
-
continual_foragax-0.
|
|
131
|
+
continual_foragax-0.36.0.dist-info/METADATA,sha256=FZVOu8G1yekPfxV7NxyWBXWRdTECWYB3gh08v2o4NIQ,4713
|
|
132
|
+
continual_foragax-0.36.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
133
|
+
continual_foragax-0.36.0.dist-info/entry_points.txt,sha256=Qiu6iE_XudrDO_bVAMeA435h4PO9ourt8huvSHiuMPc,41
|
|
134
|
+
continual_foragax-0.36.0.dist-info/top_level.txt,sha256=-z3SDK6RfLIcLI24n8rdbeFzlVY3hunChzlu-v1Fncs,8
|
|
135
|
+
continual_foragax-0.36.0.dist-info/RECORD,,
|
foragax/env.py
CHANGED
|
@@ -690,11 +690,16 @@ class ForagaxEnv(environment.Environment):
|
|
|
690
690
|
|
|
691
691
|
num_biomes = self.biome_object_frequencies.shape[0]
|
|
692
692
|
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
693
|
+
if isinstance(self.biome_consumption_threshold, float):
|
|
694
|
+
# Compute consumption rates for all biomes
|
|
695
|
+
consumption_rates = biome_state.consumption_count / jnp.maximum(
|
|
696
|
+
1.0, biome_state.total_objects.astype(float)
|
|
697
|
+
)
|
|
698
|
+
should_respawn = consumption_rates >= self.biome_consumption_threshold
|
|
699
|
+
else:
|
|
700
|
+
should_respawn = (
|
|
701
|
+
biome_state.consumption_count >= self.biome_consumption_threshold
|
|
702
|
+
)
|
|
698
703
|
|
|
699
704
|
# Split key for all biomes in parallel
|
|
700
705
|
key, subkey = jax.random.split(key)
|
foragax/objects.py
CHANGED
|
@@ -240,6 +240,7 @@ class FourierObject(BaseForagaxObject):
|
|
|
240
240
|
color: Tuple[int, int, int] = (0, 0, 0),
|
|
241
241
|
reward_delay: int = 0,
|
|
242
242
|
max_reward_delay: Optional[int] = None,
|
|
243
|
+
regen_delay: Optional[Tuple[int, int]] = None,
|
|
243
244
|
):
|
|
244
245
|
if max_reward_delay is None:
|
|
245
246
|
max_reward_delay = reward_delay
|
|
@@ -248,13 +249,14 @@ class FourierObject(BaseForagaxObject):
|
|
|
248
249
|
blocking=False,
|
|
249
250
|
collectable=True,
|
|
250
251
|
color=color,
|
|
251
|
-
random_respawn=
|
|
252
|
+
random_respawn=True,
|
|
252
253
|
max_reward_delay=max_reward_delay,
|
|
253
254
|
expiry_time=None,
|
|
254
255
|
)
|
|
255
256
|
self.num_fourier_terms = num_fourier_terms
|
|
256
257
|
self.base_magnitude = base_magnitude
|
|
257
258
|
self.reward_delay_val = reward_delay
|
|
259
|
+
self.regen_delay_range = regen_delay
|
|
258
260
|
|
|
259
261
|
def get_state(self, key: jax.Array) -> jax.Array:
|
|
260
262
|
"""Generate random Fourier series parameters.
|
|
@@ -353,6 +355,9 @@ class FourierObject(BaseForagaxObject):
|
|
|
353
355
|
|
|
354
356
|
def regen_delay(self, clock: int, rng: jax.Array) -> int:
|
|
355
357
|
"""No individual regeneration - returns infinity."""
|
|
358
|
+
if self.regen_delay_range is not None:
|
|
359
|
+
min_delay, max_delay = self.regen_delay_range
|
|
360
|
+
return jax.random.randint(rng, (), min_delay, max_delay)
|
|
356
361
|
return jnp.iinfo(jnp.int32).max
|
|
357
362
|
|
|
358
363
|
def expiry_regen_delay(self, clock: int, rng: jax.Array) -> int:
|
|
@@ -709,6 +714,7 @@ def create_fourier_objects(
|
|
|
709
714
|
num_fourier_terms: int = 10,
|
|
710
715
|
base_magnitude: float = 1.0,
|
|
711
716
|
reward_delay: int = 0,
|
|
717
|
+
regen_delay: Optional[Tuple[int, int]] = None,
|
|
712
718
|
):
|
|
713
719
|
"""Create HOT and COLD FourierObject instances.
|
|
714
720
|
|
|
@@ -726,6 +732,7 @@ def create_fourier_objects(
|
|
|
726
732
|
base_magnitude=base_magnitude,
|
|
727
733
|
color=(0, 0, 0),
|
|
728
734
|
reward_delay=reward_delay,
|
|
735
|
+
regen_delay=regen_delay,
|
|
729
736
|
)
|
|
730
737
|
|
|
731
738
|
cold = FourierObject(
|
|
@@ -734,6 +741,7 @@ def create_fourier_objects(
|
|
|
734
741
|
base_magnitude=base_magnitude,
|
|
735
742
|
color=(0, 0, 0),
|
|
736
743
|
reward_delay=reward_delay,
|
|
744
|
+
regen_delay=regen_delay,
|
|
737
745
|
)
|
|
738
746
|
|
|
739
747
|
return hot, cold
|
foragax/registry.py
CHANGED
|
@@ -104,6 +104,30 @@ ENV_CONFIGS: Dict[str, Dict[str, Any]] = {
|
|
|
104
104
|
"dynamic_biomes": True,
|
|
105
105
|
"biome_consumption_threshold": 0.9,
|
|
106
106
|
},
|
|
107
|
+
"ForagaxDiwali-v2": {
|
|
108
|
+
"size": (15, 15),
|
|
109
|
+
"aperture_size": None,
|
|
110
|
+
"objects": None,
|
|
111
|
+
"biomes": (
|
|
112
|
+
# Hot biome
|
|
113
|
+
Biome(start=(0, 2), stop=(15, 6), object_frequencies=(0.5, 0.0)),
|
|
114
|
+
# Cold biome
|
|
115
|
+
Biome(start=(0, 9), stop=(15, 13), object_frequencies=(0.0, 0.5)),
|
|
116
|
+
),
|
|
117
|
+
"nowrap": False,
|
|
118
|
+
"deterministic_spawn": True,
|
|
119
|
+
"dynamic_biomes": True,
|
|
120
|
+
"biome_consumption_threshold": 200,
|
|
121
|
+
},
|
|
122
|
+
"ForagaxDiwali-v3": {
|
|
123
|
+
"size": (15, 15),
|
|
124
|
+
"aperture_size": None,
|
|
125
|
+
"objects": None,
|
|
126
|
+
"biomes": (Biome(start=(0, 0), stop=(15, 15), object_frequencies=(0.5,)),),
|
|
127
|
+
"nowrap": False,
|
|
128
|
+
"deterministic_spawn": True,
|
|
129
|
+
"dynamic_biomes": True,
|
|
130
|
+
},
|
|
107
131
|
"ForagaxTwoBiome-v1": {
|
|
108
132
|
"size": (15, 15),
|
|
109
133
|
"aperture_size": None,
|
|
@@ -539,6 +563,18 @@ def make(
|
|
|
539
563
|
num_fourier_terms=10,
|
|
540
564
|
reward_delay=reward_delay,
|
|
541
565
|
)
|
|
566
|
+
if env_id == "ForagaxDiwali-v2":
|
|
567
|
+
config["objects"] = create_fourier_objects(
|
|
568
|
+
num_fourier_terms=10,
|
|
569
|
+
reward_delay=reward_delay,
|
|
570
|
+
regen_delay=(9, 11),
|
|
571
|
+
)
|
|
572
|
+
if env_id == "ForagaxDiwali-v3":
|
|
573
|
+
config["objects"] = create_fourier_objects(
|
|
574
|
+
num_fourier_terms=10,
|
|
575
|
+
reward_delay=reward_delay,
|
|
576
|
+
regen_delay=(9, 11),
|
|
577
|
+
)[:1]
|
|
542
578
|
|
|
543
579
|
if env_id == "ForagaxSineTwoBiome-v1":
|
|
544
580
|
biome1_oyster, biome1_deathcap, biome2_oyster, biome2_deathcap = (
|
|
File without changes
|
|
File without changes
|
|
File without changes
|