continual-foragax 0.36.0__tar.gz → 0.37.0__tar.gz
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.36.0 → continual_foragax-0.37.0}/PKG-INFO +1 -1
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/pyproject.toml +2 -2
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/continual_foragax.egg-info/PKG-INFO +1 -1
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/env.py +40 -36
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/objects.py +6 -1
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/registry.py +22 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/tests/test_foragax.py +110 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/README.md +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/setup.cfg +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/continual_foragax.egg-info/SOURCES.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/continual_foragax.egg-info/dependency_links.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/continual_foragax.egg-info/entry_points.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/continual_foragax.egg-info/requires.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/continual_foragax.egg-info/top_level.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/__init__.py +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/colors.py +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID100897.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID100928.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID100929.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID100930.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID100931.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID106714.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID106715.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID106716.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID106717.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID106718.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID106930.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID106931.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID106932.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID106933.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID106934.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID106935.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID106936.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID106937.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID106938.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID106939.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID106940.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID106941.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID106942.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID106943.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID106994.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID106995.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID106996.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID106997.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID106998.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID106999.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107000.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107001.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107002.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107003.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107004.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107005.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107006.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107007.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107008.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107009.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107010.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107011.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107012.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107013.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107014.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107015.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107016.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107017.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107018.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107019.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107020.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107021.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107022.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107023.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107024.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107025.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107026.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107027.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107028.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107029.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107030.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107031.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107032.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107033.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107034.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107035.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107036.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107037.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107038.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107039.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107040.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107041.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107042.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107043.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107044.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107045.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107046.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107047.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107048.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107049.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107050.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107051.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107052.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107053.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107054.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107055.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107056.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107057.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107058.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107059.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107060.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107061.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107062.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107063.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107064.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107065.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107066.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107067.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107068.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107069.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107070.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107071.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID115808.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID115812.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID146811.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID156831.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID156835.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID156839.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID156843.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID156847.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID156851.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID156855.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID156859.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID156863.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID156867.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID156871.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID156875.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID156879.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID156883.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID156887.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/elements.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/metadata.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/data/ECA_non-blended_custom/sources.txt +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/rendering.py +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/foragax/weather.py +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/tests/test_benchmark.py +0 -0
- {continual_foragax-0.36.0 → continual_foragax-0.37.0}/tests/test_registry.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "continual-foragax"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.37.0"
|
|
4
4
|
description = "A continual reinforcement learning benchmark"
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
authors = [
|
|
@@ -30,7 +30,7 @@ build-backend = "setuptools.build_meta"
|
|
|
30
30
|
[tool]
|
|
31
31
|
[tool.commitizen]
|
|
32
32
|
name = "cz_conventional_commits"
|
|
33
|
-
version = "0.
|
|
33
|
+
version = "0.37.0"
|
|
34
34
|
tag_format = "$version"
|
|
35
35
|
version_files = ["pyproject.toml"]
|
|
36
36
|
|
|
@@ -132,6 +132,7 @@ class ForagaxEnv(environment.Environment):
|
|
|
132
132
|
observation_type: str = "object",
|
|
133
133
|
dynamic_biomes: bool = False,
|
|
134
134
|
biome_consumption_threshold: float = 0.9,
|
|
135
|
+
max_expiries_per_step: int = 1,
|
|
135
136
|
):
|
|
136
137
|
super().__init__()
|
|
137
138
|
self._name = name
|
|
@@ -155,6 +156,9 @@ class ForagaxEnv(environment.Environment):
|
|
|
155
156
|
self.teleport_interval = teleport_interval
|
|
156
157
|
self.dynamic_biomes = dynamic_biomes
|
|
157
158
|
self.biome_consumption_threshold = biome_consumption_threshold
|
|
159
|
+
if max_expiries_per_step < 1:
|
|
160
|
+
raise ValueError("max_expiries_per_step must be at least 1")
|
|
161
|
+
self.max_expiries_per_step = max_expiries_per_step
|
|
158
162
|
|
|
159
163
|
objects = (EMPTY,) + objects
|
|
160
164
|
if self.nowrap and not self.full_world:
|
|
@@ -608,63 +612,63 @@ class ForagaxEnv(environment.Environment):
|
|
|
608
612
|
& (current_objects_for_expiry > 0)
|
|
609
613
|
)
|
|
610
614
|
|
|
611
|
-
# Count how many objects actually need to expire
|
|
612
|
-
num_expiring = jnp.sum(should_expire)
|
|
613
|
-
|
|
614
615
|
# Only process expiry if there are actually objects to expire
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
616
|
+
has_expiring = jnp.any(should_expire)
|
|
617
|
+
|
|
618
|
+
# Precompute the first expiring index in flat space so the work inside cond is minimal.
|
|
619
|
+
overage = jnp.where(
|
|
620
|
+
should_expire,
|
|
621
|
+
object_ages - expiry_times,
|
|
622
|
+
-jnp.inf,
|
|
623
|
+
).reshape(-1)
|
|
624
|
+
sorted_flat_indices = jnp.argsort(overage)[::-1]
|
|
625
|
+
selected_flat_indices = jnp.where(
|
|
626
|
+
overage[sorted_flat_indices] > -jnp.inf,
|
|
627
|
+
sorted_flat_indices,
|
|
628
|
+
-jnp.ones_like(sorted_flat_indices),
|
|
629
|
+
)[: self.max_expiries_per_step]
|
|
622
630
|
|
|
631
|
+
def process_expiries():
|
|
623
632
|
key_local, expiry_key = jax.random.split(key)
|
|
624
633
|
|
|
625
|
-
def
|
|
626
|
-
|
|
627
|
-
y = y_indices[i]
|
|
628
|
-
x = x_indices[i]
|
|
634
|
+
def body_fn(i, obj_state):
|
|
635
|
+
flat_idx = selected_flat_indices[i]
|
|
629
636
|
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
def expire_one():
|
|
637
|
+
def expire_at(obj_state):
|
|
638
|
+
y = flat_idx // self.size[0]
|
|
639
|
+
x = flat_idx % self.size[0]
|
|
634
640
|
obj_id = current_objects_for_expiry[y, x]
|
|
635
|
-
exp_key = jax.random.fold_in(expiry_key,
|
|
641
|
+
exp_key = jax.random.fold_in(expiry_key, flat_idx)
|
|
636
642
|
exp_delay = jax.lax.switch(
|
|
637
643
|
obj_id, self.expiry_regen_delay_fns, state.time, exp_key
|
|
638
644
|
)
|
|
639
645
|
timer_countdown = jax.lax.cond(
|
|
640
646
|
exp_delay == jnp.iinfo(jnp.int32).max,
|
|
641
|
-
lambda: 0,
|
|
642
|
-
lambda: exp_delay + 1,
|
|
647
|
+
lambda: 0,
|
|
648
|
+
lambda: exp_delay + 1,
|
|
643
649
|
)
|
|
644
650
|
|
|
645
|
-
|
|
646
|
-
rand_key = jax.random.
|
|
647
|
-
|
|
651
|
+
respawn_random = self.object_random_respawn[obj_id]
|
|
652
|
+
rand_key = jax.random.fold_in(exp_key, 1)
|
|
653
|
+
return self._place_timer(
|
|
648
654
|
obj_state,
|
|
649
655
|
y,
|
|
650
656
|
x,
|
|
651
657
|
obj_id,
|
|
652
658
|
timer_countdown,
|
|
653
|
-
|
|
659
|
+
respawn_random,
|
|
654
660
|
rand_key,
|
|
655
661
|
)
|
|
656
662
|
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
+
return jax.lax.cond(
|
|
664
|
+
flat_idx >= 0,
|
|
665
|
+
expire_at,
|
|
666
|
+
lambda obj_state: obj_state,
|
|
667
|
+
obj_state,
|
|
668
|
+
)
|
|
663
669
|
|
|
664
|
-
new_object_state
|
|
665
|
-
|
|
666
|
-
object_state,
|
|
667
|
-
jnp.arange(max_objects),
|
|
670
|
+
new_object_state = jax.lax.fori_loop(
|
|
671
|
+
0, self.max_expiries_per_step, body_fn, object_state
|
|
668
672
|
)
|
|
669
673
|
return key_local, new_object_state
|
|
670
674
|
|
|
@@ -672,7 +676,7 @@ class ForagaxEnv(environment.Environment):
|
|
|
672
676
|
return key, object_state
|
|
673
677
|
|
|
674
678
|
key, object_state = jax.lax.cond(
|
|
675
|
-
|
|
679
|
+
has_expiring,
|
|
676
680
|
process_expiries,
|
|
677
681
|
no_expiries,
|
|
678
682
|
)
|
|
@@ -241,6 +241,7 @@ class FourierObject(BaseForagaxObject):
|
|
|
241
241
|
reward_delay: int = 0,
|
|
242
242
|
max_reward_delay: Optional[int] = None,
|
|
243
243
|
regen_delay: Optional[Tuple[int, int]] = None,
|
|
244
|
+
reward_repeat: int = 1,
|
|
244
245
|
):
|
|
245
246
|
if max_reward_delay is None:
|
|
246
247
|
max_reward_delay = reward_delay
|
|
@@ -257,6 +258,7 @@ class FourierObject(BaseForagaxObject):
|
|
|
257
258
|
self.base_magnitude = base_magnitude
|
|
258
259
|
self.reward_delay_val = reward_delay
|
|
259
260
|
self.regen_delay_range = regen_delay
|
|
261
|
+
self.reward_repeat = reward_repeat
|
|
260
262
|
|
|
261
263
|
def get_state(self, key: jax.Array) -> jax.Array:
|
|
262
264
|
"""Generate random Fourier series parameters.
|
|
@@ -321,7 +323,7 @@ class FourierObject(BaseForagaxObject):
|
|
|
321
323
|
y_max = params[2]
|
|
322
324
|
|
|
323
325
|
# Normalize time to [0, 2π] using the object's period
|
|
324
|
-
t = 2.0 * jnp.pi * (clock % period) / period
|
|
326
|
+
t = 2.0 * jnp.pi * ((clock // self.reward_repeat) % period) / period
|
|
325
327
|
|
|
326
328
|
# Extract interleaved coefficients: [a1, b1, a2, b2, ...]
|
|
327
329
|
ab_coeffs = params[3:]
|
|
@@ -715,6 +717,7 @@ def create_fourier_objects(
|
|
|
715
717
|
base_magnitude: float = 1.0,
|
|
716
718
|
reward_delay: int = 0,
|
|
717
719
|
regen_delay: Optional[Tuple[int, int]] = None,
|
|
720
|
+
reward_repeat: int = 1,
|
|
718
721
|
):
|
|
719
722
|
"""Create HOT and COLD FourierObject instances.
|
|
720
723
|
|
|
@@ -733,6 +736,7 @@ def create_fourier_objects(
|
|
|
733
736
|
color=(0, 0, 0),
|
|
734
737
|
reward_delay=reward_delay,
|
|
735
738
|
regen_delay=regen_delay,
|
|
739
|
+
reward_repeat=reward_repeat,
|
|
736
740
|
)
|
|
737
741
|
|
|
738
742
|
cold = FourierObject(
|
|
@@ -742,6 +746,7 @@ def create_fourier_objects(
|
|
|
742
746
|
color=(0, 0, 0),
|
|
743
747
|
reward_delay=reward_delay,
|
|
744
748
|
regen_delay=regen_delay,
|
|
749
|
+
reward_repeat=reward_repeat,
|
|
745
750
|
)
|
|
746
751
|
|
|
747
752
|
return hot, cold
|
|
@@ -128,6 +128,21 @@ ENV_CONFIGS: Dict[str, Dict[str, Any]] = {
|
|
|
128
128
|
"deterministic_spawn": True,
|
|
129
129
|
"dynamic_biomes": True,
|
|
130
130
|
},
|
|
131
|
+
"ForagaxDiwali-v4": {
|
|
132
|
+
"size": (15, 15),
|
|
133
|
+
"aperture_size": None,
|
|
134
|
+
"objects": None,
|
|
135
|
+
"biomes": (
|
|
136
|
+
# Hot biome
|
|
137
|
+
Biome(start=(0, 2), stop=(15, 6), object_frequencies=(0.5, 0.0)),
|
|
138
|
+
# Cold biome
|
|
139
|
+
Biome(start=(0, 9), stop=(15, 13), object_frequencies=(0.0, 0.5)),
|
|
140
|
+
),
|
|
141
|
+
"nowrap": False,
|
|
142
|
+
"deterministic_spawn": True,
|
|
143
|
+
"dynamic_biomes": True,
|
|
144
|
+
"biome_consumption_threshold": 1000,
|
|
145
|
+
},
|
|
131
146
|
"ForagaxTwoBiome-v1": {
|
|
132
147
|
"size": (15, 15),
|
|
133
148
|
"aperture_size": None,
|
|
@@ -575,6 +590,13 @@ def make(
|
|
|
575
590
|
reward_delay=reward_delay,
|
|
576
591
|
regen_delay=(9, 11),
|
|
577
592
|
)[:1]
|
|
593
|
+
if env_id == "ForagaxDiwali-v4":
|
|
594
|
+
config["objects"] = create_fourier_objects(
|
|
595
|
+
num_fourier_terms=10,
|
|
596
|
+
reward_delay=reward_delay,
|
|
597
|
+
regen_delay=(9, 11),
|
|
598
|
+
reward_repeat=100,
|
|
599
|
+
)
|
|
578
600
|
|
|
579
601
|
if env_id == "ForagaxSineTwoBiome-v1":
|
|
580
602
|
biome1_oyster, biome1_deathcap, biome2_oyster, biome2_deathcap = (
|
|
@@ -1268,6 +1268,7 @@ def test_basic_object_expiry():
|
|
|
1268
1268
|
objects=(expiring_object,),
|
|
1269
1269
|
biomes=(Biome(object_frequencies=(1.0,)),),
|
|
1270
1270
|
observation_type="object",
|
|
1271
|
+
max_expiries_per_step=10, # Ensure all expiries processed each step
|
|
1271
1272
|
)
|
|
1272
1273
|
|
|
1273
1274
|
key = jax.random.key(0)
|
|
@@ -1316,6 +1317,112 @@ def test_basic_object_expiry():
|
|
|
1316
1317
|
assert state.time == 9 # Current time after step completes
|
|
1317
1318
|
|
|
1318
1319
|
|
|
1320
|
+
def test_basic_object_expiry_one():
|
|
1321
|
+
"""Test that objects expire and respawn after expiry_time steps."""
|
|
1322
|
+
# Create an object that expires after 5 steps with expiry_regen_delay=(2, 2)
|
|
1323
|
+
# Note: Due to timer encoding, delay=2 actually takes 3 steps (consistent with regen_delay)
|
|
1324
|
+
expiring_object = DefaultForagaxObject(
|
|
1325
|
+
name="expiring",
|
|
1326
|
+
reward=1.0,
|
|
1327
|
+
collectable=False, # Not collectable, so it won't be removed by collection
|
|
1328
|
+
color=(255, 0, 0),
|
|
1329
|
+
expiry_time=10,
|
|
1330
|
+
expiry_regen_delay=(8, 8), # Takes 9 steps due to +1 in timer encoding
|
|
1331
|
+
)
|
|
1332
|
+
|
|
1333
|
+
env = ForagaxEnv(
|
|
1334
|
+
size=(3, 3),
|
|
1335
|
+
aperture_size=(3, 3),
|
|
1336
|
+
objects=(expiring_object,),
|
|
1337
|
+
biomes=(Biome(object_frequencies=(1.0,)),),
|
|
1338
|
+
observation_type="object",
|
|
1339
|
+
)
|
|
1340
|
+
|
|
1341
|
+
key = jax.random.key(0)
|
|
1342
|
+
key, key_reset = jax.random.split(key)
|
|
1343
|
+
obs, state = env.reset(key_reset, env.default_params)
|
|
1344
|
+
|
|
1345
|
+
# Initial state - all objects present
|
|
1346
|
+
assert jnp.all(state.object_state.object_id == 1)
|
|
1347
|
+
assert jnp.all(state.object_state.spawn_time == 0)
|
|
1348
|
+
|
|
1349
|
+
# Step through 10 times - objects should still be present
|
|
1350
|
+
for _ in range(10):
|
|
1351
|
+
key, key_step = jax.random.split(key)
|
|
1352
|
+
obs, state, _, _, _ = env.step(
|
|
1353
|
+
key_step, state, Actions.DOWN, env.default_params
|
|
1354
|
+
)
|
|
1355
|
+
|
|
1356
|
+
assert jnp.all(state.object_state.object_id == 1)
|
|
1357
|
+
assert state.time == 10
|
|
1358
|
+
|
|
1359
|
+
# Step once more - objects should expire and become timers
|
|
1360
|
+
key, key_step = jax.random.split(key)
|
|
1361
|
+
obs, state, _, _, _ = env.step(key_step, state, Actions.DOWN, env.default_params)
|
|
1362
|
+
|
|
1363
|
+
assert (
|
|
1364
|
+
jnp.count_nonzero(state.object_state.object_id == 0) == 1
|
|
1365
|
+
) # One objects removed
|
|
1366
|
+
assert (
|
|
1367
|
+
jnp.count_nonzero(state.object_state.respawn_timer > 0) == 1
|
|
1368
|
+
) # One have timers
|
|
1369
|
+
assert (
|
|
1370
|
+
jnp.count_nonzero(state.object_state.respawn_object_id == 1) == 1
|
|
1371
|
+
) # Will respawn as object 1
|
|
1372
|
+
assert jnp.all(
|
|
1373
|
+
state.object_state.spawn_time == 0
|
|
1374
|
+
) # Spawn time NOT updated yet (still at reset value)
|
|
1375
|
+
|
|
1376
|
+
# Step through all removals and they all become timers (8 more steps)
|
|
1377
|
+
for _ in range(8):
|
|
1378
|
+
key, key_step = jax.random.split(key)
|
|
1379
|
+
obs, state, _, _, _ = env.step(
|
|
1380
|
+
key_step, state, Actions.DOWN, env.default_params
|
|
1381
|
+
)
|
|
1382
|
+
|
|
1383
|
+
assert jnp.all(state.object_state.object_id == 0) # All objects removed
|
|
1384
|
+
assert jnp.all(state.object_state.respawn_timer > 0) # All have timers
|
|
1385
|
+
assert jnp.all(
|
|
1386
|
+
state.object_state.respawn_object_id == 1
|
|
1387
|
+
) # Will respawn as object 1
|
|
1388
|
+
assert jnp.all(
|
|
1389
|
+
state.object_state.spawn_time == 0
|
|
1390
|
+
) # Spawn time NOT updated yet (still at reset value)
|
|
1391
|
+
|
|
1392
|
+
# Step once more - one object should respawn
|
|
1393
|
+
key, key_step = jax.random.split(key)
|
|
1394
|
+
obs, state, _, _, _ = env.step(key_step, state, Actions.DOWN, env.default_params)
|
|
1395
|
+
|
|
1396
|
+
assert (
|
|
1397
|
+
jnp.count_nonzero(state.object_state.object_id == 0) == 8
|
|
1398
|
+
) # One objects present
|
|
1399
|
+
assert (
|
|
1400
|
+
jnp.count_nonzero(state.object_state.respawn_timer > 0) == 8
|
|
1401
|
+
) # One don't have timers
|
|
1402
|
+
assert (
|
|
1403
|
+
jnp.count_nonzero(state.object_state.respawn_object_id == 1) == 8
|
|
1404
|
+
) # Remaining will respawn as object 1
|
|
1405
|
+
assert (
|
|
1406
|
+
jnp.count_nonzero(state.object_state.spawn_time == 19) == 1
|
|
1407
|
+
) # One with updated spawn time
|
|
1408
|
+
|
|
1409
|
+
# Step through regen delay for remaining (8 more objects)
|
|
1410
|
+
for _ in range(8):
|
|
1411
|
+
key, key_step = jax.random.split(key)
|
|
1412
|
+
obs, state, _, _, _ = env.step(
|
|
1413
|
+
key_step, state, Actions.DOWN, env.default_params
|
|
1414
|
+
)
|
|
1415
|
+
|
|
1416
|
+
assert jnp.all(state.object_state.object_id == 1) # Objects respawned
|
|
1417
|
+
assert jnp.all(state.object_state.respawn_timer == 0) # Timers cleared
|
|
1418
|
+
print(state.object_state.spawn_time)
|
|
1419
|
+
assert jnp.all(
|
|
1420
|
+
jnp.sort(state.object_state.spawn_time.flatten())
|
|
1421
|
+
== jnp.sort(jnp.arange(19, 28))
|
|
1422
|
+
) # Spawn time = time at beginning of step when respawn occurred
|
|
1423
|
+
assert state.time == 28 # Current time after step completes
|
|
1424
|
+
|
|
1425
|
+
|
|
1319
1426
|
def test_no_expiry_backwards_compatibility():
|
|
1320
1427
|
"""Test that objects without expiry_time don't expire."""
|
|
1321
1428
|
non_expiring_object = DefaultForagaxObject(
|
|
@@ -1412,6 +1519,7 @@ def test_expiry_with_normal_regen():
|
|
|
1412
1519
|
objects=(normal_expiring,),
|
|
1413
1520
|
biomes=(Biome(object_frequencies=(1.0,)),),
|
|
1414
1521
|
observation_type="object",
|
|
1522
|
+
max_expiries_per_step=16, # Ensure all expiries processed each step
|
|
1415
1523
|
)
|
|
1416
1524
|
|
|
1417
1525
|
key = jax.random.key(456)
|
|
@@ -1506,6 +1614,7 @@ def test_expiry_spawn_time_tracking():
|
|
|
1506
1614
|
objects=(expiring_obj,),
|
|
1507
1615
|
biomes=(Biome(object_frequencies=(1.0,)),),
|
|
1508
1616
|
observation_type="object",
|
|
1617
|
+
max_expiries_per_step=4, # Ensure all expiries processed each step
|
|
1509
1618
|
)
|
|
1510
1619
|
|
|
1511
1620
|
key = jax.random.key(111)
|
|
@@ -1878,6 +1987,7 @@ def test_object_color_grid_cleared_on_expiry():
|
|
|
1878
1987
|
biomes=(Biome(object_frequencies=(0.5,)),),
|
|
1879
1988
|
observation_type="color",
|
|
1880
1989
|
dynamic_biomes=True, # Enable dynamic biomes to test color grid
|
|
1990
|
+
max_expiries_per_step=25, # Ensure all expiries processed each step
|
|
1881
1991
|
)
|
|
1882
1992
|
|
|
1883
1993
|
key = jax.random.key(42)
|
|
File without changes
|
|
File without changes
|
{continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/continual_foragax.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/continual_foragax.egg-info/requires.txt
RENAMED
|
File without changes
|
{continual_foragax-0.36.0 → continual_foragax-0.37.0}/src/continual_foragax.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|