continual-foragax 0.11.0__tar.gz → 0.12.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.11.0 → continual_foragax-0.12.0}/PKG-INFO +1 -1
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/pyproject.toml +2 -2
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/continual_foragax.egg-info/PKG-INFO +1 -1
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/env.py +38 -7
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/objects.py +2 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/registry.py +4 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/tests/test_foragax.py +91 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/README.md +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/setup.cfg +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/continual_foragax.egg-info/SOURCES.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/continual_foragax.egg-info/dependency_links.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/continual_foragax.egg-info/entry_points.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/continual_foragax.egg-info/requires.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/continual_foragax.egg-info/top_level.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/__init__.py +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/colors.py +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID100897.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID100928.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID100929.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID100930.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID100931.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID106714.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID106715.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID106716.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID106717.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID106718.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID106930.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID106931.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID106932.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID106933.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID106934.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID106935.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID106936.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID106937.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID106938.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID106939.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID106940.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID106941.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID106942.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID106943.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID106994.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID106995.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID106996.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID106997.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID106998.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID106999.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107000.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107001.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107002.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107003.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107004.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107005.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107006.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107007.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107008.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107009.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107010.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107011.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107012.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107013.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107014.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107015.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107016.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107017.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107018.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107019.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107020.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107021.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107022.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107023.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107024.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107025.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107026.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107027.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107028.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107029.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107030.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107031.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107032.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107033.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107034.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107035.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107036.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107037.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107038.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107039.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107040.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107041.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107042.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107043.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107044.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107045.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107046.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107047.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107048.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107049.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107050.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107051.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107052.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107053.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107054.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107055.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107056.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107057.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107058.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107059.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107060.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107061.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107062.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107063.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107064.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107065.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107066.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107067.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107068.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107069.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107070.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID107071.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID115808.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID115812.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID146811.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID156831.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID156835.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID156839.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID156843.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID156847.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID156851.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID156855.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID156859.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID156863.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID156867.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID156871.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID156875.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID156879.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID156883.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/TG_SOUID156887.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/elements.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/metadata.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/data/ECA_non-blended_custom/sources.txt +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/rendering.py +0 -0
- {continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/foragax/weather.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
[project]
|
2
2
|
name = "continual-foragax"
|
3
|
-
version = "0.
|
3
|
+
version = "0.12.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.12.0"
|
34
34
|
tag_format = "$version"
|
35
35
|
version_files = ["pyproject.toml"]
|
36
36
|
|
@@ -13,7 +13,13 @@ import jax.numpy as jnp
|
|
13
13
|
from flax import struct
|
14
14
|
from gymnax.environments import environment, spaces
|
15
15
|
|
16
|
-
from foragax.objects import
|
16
|
+
from foragax.objects import (
|
17
|
+
AGENT,
|
18
|
+
EMPTY,
|
19
|
+
PADDING,
|
20
|
+
BaseForagaxObject,
|
21
|
+
WeatherObject,
|
22
|
+
)
|
17
23
|
from foragax.rendering import apply_true_borders
|
18
24
|
from foragax.weather import get_temperature
|
19
25
|
|
@@ -64,6 +70,7 @@ class ForagaxEnv(environment.Environment):
|
|
64
70
|
aperture_size: Union[Tuple[int, int], int] = (5, 5),
|
65
71
|
objects: Tuple[BaseForagaxObject, ...] = (),
|
66
72
|
biomes: Tuple[Biome, ...] = (Biome(object_frequencies=()),),
|
73
|
+
nowrap: bool = False,
|
67
74
|
):
|
68
75
|
super().__init__()
|
69
76
|
if isinstance(size, int):
|
@@ -73,7 +80,10 @@ class ForagaxEnv(environment.Environment):
|
|
73
80
|
if isinstance(aperture_size, int):
|
74
81
|
aperture_size = (aperture_size, aperture_size)
|
75
82
|
self.aperture_size = aperture_size
|
83
|
+
self.nowrap = nowrap
|
76
84
|
objects = (EMPTY,) + objects
|
85
|
+
if self.nowrap:
|
86
|
+
objects = objects + (PADDING,)
|
77
87
|
self.objects = objects
|
78
88
|
self.weather_object = None
|
79
89
|
for o in objects:
|
@@ -122,8 +132,12 @@ class ForagaxEnv(environment.Environment):
|
|
122
132
|
direction = DIRECTIONS[action]
|
123
133
|
new_pos = state.pos + direction
|
124
134
|
|
125
|
-
|
126
|
-
|
135
|
+
if self.nowrap:
|
136
|
+
in_bounds = jnp.all((new_pos >= 0) & (new_pos < jnp.array(self.size)))
|
137
|
+
new_pos = jnp.where(in_bounds, new_pos, state.pos)
|
138
|
+
else:
|
139
|
+
# Wrap around boundaries
|
140
|
+
new_pos = jnp.mod(new_pos, jnp.array(self.size))
|
127
141
|
|
128
142
|
# Check for blocking objects
|
129
143
|
obj_at_new_pos = current_objects[new_pos[1], new_pos[0]]
|
@@ -288,10 +302,26 @@ class ForagaxEnv(environment.Environment):
|
|
288
302
|
|
289
303
|
y_offsets = jnp.arange(ap_h)
|
290
304
|
x_offsets = jnp.arange(ap_w)
|
291
|
-
y_coords =
|
292
|
-
x_coords =
|
305
|
+
y_coords = start_y + y_offsets[:, None]
|
306
|
+
x_coords = start_x + x_offsets
|
307
|
+
|
308
|
+
if self.nowrap:
|
309
|
+
# Clamp coordinates to bounds
|
310
|
+
y_coords_clamped = jnp.clip(y_coords, 0, self.size[1] - 1)
|
311
|
+
x_coords_clamped = jnp.clip(x_coords, 0, self.size[0] - 1)
|
312
|
+
values = object_grid[y_coords_clamped, x_coords_clamped]
|
313
|
+
# Mark out-of-bounds positions with -1
|
314
|
+
y_out = (y_coords < 0) | (y_coords >= self.size[1])
|
315
|
+
x_out = (x_coords < 0) | (x_coords >= self.size[0])
|
316
|
+
out_of_bounds = y_out | x_out
|
317
|
+
padding_index = self.object_ids[-1]
|
318
|
+
aperture = jnp.where(out_of_bounds, padding_index, values)
|
319
|
+
else:
|
320
|
+
y_coords_mod = jnp.mod(y_coords, self.size[1])
|
321
|
+
x_coords_mod = jnp.mod(x_coords, self.size[0])
|
322
|
+
aperture = object_grid[y_coords_mod, x_coords_mod]
|
293
323
|
|
294
|
-
return
|
324
|
+
return aperture
|
295
325
|
|
296
326
|
@partial(jax.jit, static_argnames=("self", "render_mode"))
|
297
327
|
def render(self, state: EnvState, params: EnvParams, render_mode: str = "world"):
|
@@ -404,8 +434,9 @@ class ForagaxObjectEnv(ForagaxEnv):
|
|
404
434
|
aperture_size: Union[Tuple[int, int], int] = (5, 5),
|
405
435
|
objects: Tuple[BaseForagaxObject, ...] = (),
|
406
436
|
biomes: Tuple[Biome, ...] = (Biome(object_frequencies=()),),
|
437
|
+
nowrap: bool = False,
|
407
438
|
):
|
408
|
-
super().__init__(size, aperture_size, objects, biomes)
|
439
|
+
super().__init__(size, aperture_size, objects, biomes, nowrap)
|
409
440
|
|
410
441
|
# Compute unique colors and mapping for partial observability
|
411
442
|
# Exclude EMPTY (index 0) from color channels
|
@@ -179,6 +179,8 @@ DEATHCAP = DefaultForagaxObject(
|
|
179
179
|
)
|
180
180
|
AGENT = DefaultForagaxObject(name="agent", blocking=True, color=(0, 0, 255))
|
181
181
|
|
182
|
+
PADDING = DefaultForagaxObject(name="padding", blocking=True, color=(0, 0, 0))
|
183
|
+
|
182
184
|
BROWN_MOREL = NormalRegenForagaxObject(
|
183
185
|
name="brown_morel",
|
184
186
|
reward=30.0,
|
@@ -75,6 +75,7 @@ def make(
|
|
75
75
|
observation_type: str = "object",
|
76
76
|
aperture_size: Optional[Tuple[int, int]] = (5, 5),
|
77
77
|
file_index: int = 0,
|
78
|
+
nowrap: bool = False,
|
78
79
|
) -> ForagaxEnv:
|
79
80
|
"""Create a Foragax environment.
|
80
81
|
|
@@ -83,6 +84,8 @@ def make(
|
|
83
84
|
observation_type: The type of observation to use. One of "object", "rgb", or "world".
|
84
85
|
aperture_size: The size of the agent's observation aperture. If None, the default
|
85
86
|
for the environment is used.
|
87
|
+
file_index: File index for weather objects.
|
88
|
+
nowrap: If True, disables wrapping around environment boundaries.
|
86
89
|
|
87
90
|
Returns:
|
88
91
|
A Foragax environment instance.
|
@@ -93,6 +96,7 @@ def make(
|
|
93
96
|
config = ENV_CONFIGS[env_id].copy()
|
94
97
|
|
95
98
|
config["aperture_size"] = aperture_size
|
99
|
+
config["nowrap"] = nowrap
|
96
100
|
|
97
101
|
if env_id.startswith("ForagaxWeather"):
|
98
102
|
hot, cold = create_weather_objects(file_index=file_index)
|
@@ -364,6 +364,63 @@ def test_wrapping_dynamics():
|
|
364
364
|
assert jnp.array_equal(state.pos, jnp.array([2, 2]))
|
365
365
|
|
366
366
|
|
367
|
+
def test_no_wrapping_dynamics():
|
368
|
+
"""Test that the agent does not wrap around the environment boundaries when nowrap=True."""
|
369
|
+
key = jax.random.key(0)
|
370
|
+
env = ForagaxObjectEnv(size=(5, 5), objects=(), nowrap=True)
|
371
|
+
params = env.default_params
|
372
|
+
_, state = env.reset(key, params)
|
373
|
+
|
374
|
+
# Agent starts at center (2,2)
|
375
|
+
|
376
|
+
# Move to top edge
|
377
|
+
for _ in range(2):
|
378
|
+
key, step_key = jax.random.split(key)
|
379
|
+
_, state, _, _, _ = env.step(step_key, state, Actions.UP, params)
|
380
|
+
assert jnp.array_equal(state.pos, jnp.array([2, 0])) # at top
|
381
|
+
|
382
|
+
# Try to move up again, should stay put
|
383
|
+
key, step_key = jax.random.split(key)
|
384
|
+
_, state, _, _, _ = env.step(step_key, state, Actions.UP, params)
|
385
|
+
assert jnp.array_equal(state.pos, jnp.array([2, 0])) # still at top
|
386
|
+
|
387
|
+
# Move to bottom edge
|
388
|
+
_, state = env.reset(key, params)
|
389
|
+
for _ in range(2):
|
390
|
+
key, step_key = jax.random.split(key)
|
391
|
+
_, state, _, _, _ = env.step(step_key, state, Actions.DOWN, params)
|
392
|
+
assert jnp.array_equal(state.pos, jnp.array([2, 4])) # at bottom
|
393
|
+
|
394
|
+
# Try to move down again, should stay put
|
395
|
+
key, step_key = jax.random.split(key)
|
396
|
+
_, state, _, _, _ = env.step(step_key, state, Actions.DOWN, params)
|
397
|
+
assert jnp.array_equal(state.pos, jnp.array([2, 4])) # still at bottom
|
398
|
+
|
399
|
+
# Move to left edge
|
400
|
+
_, state = env.reset(key, params)
|
401
|
+
for _ in range(2):
|
402
|
+
key, step_key = jax.random.split(key)
|
403
|
+
_, state, _, _, _ = env.step(step_key, state, Actions.LEFT, params)
|
404
|
+
assert jnp.array_equal(state.pos, jnp.array([0, 2])) # at left
|
405
|
+
|
406
|
+
# Try to move left again, should stay put
|
407
|
+
key, step_key = jax.random.split(key)
|
408
|
+
_, state, _, _, _ = env.step(step_key, state, Actions.LEFT, params)
|
409
|
+
assert jnp.array_equal(state.pos, jnp.array([0, 2])) # still at left
|
410
|
+
|
411
|
+
# Move to right edge
|
412
|
+
_, state = env.reset(key, params)
|
413
|
+
for _ in range(2):
|
414
|
+
key, step_key = jax.random.split(key)
|
415
|
+
_, state, _, _, _ = env.step(step_key, state, Actions.RIGHT, params)
|
416
|
+
assert jnp.array_equal(state.pos, jnp.array([4, 2])) # at right
|
417
|
+
|
418
|
+
# Try to move right again, should stay put
|
419
|
+
key, step_key = jax.random.split(key)
|
420
|
+
_, state, _, _, _ = env.step(step_key, state, Actions.RIGHT, params)
|
421
|
+
assert jnp.array_equal(state.pos, jnp.array([4, 2])) # still at right
|
422
|
+
|
423
|
+
|
367
424
|
def test_wrapping_vision():
|
368
425
|
"""Test that the agent's vision wraps around the environment boundaries."""
|
369
426
|
key = jax.random.key(0)
|
@@ -408,6 +465,40 @@ def test_wrapping_vision():
|
|
408
465
|
assert jnp.array_equal(obs, expected)
|
409
466
|
|
410
467
|
|
468
|
+
def test_no_wrapping_vision():
|
469
|
+
"""Test that the agent's vision does not wrap around boundaries when nowrap=True."""
|
470
|
+
key = jax.random.key(0)
|
471
|
+
object_types = (FLOWER,)
|
472
|
+
env_no_wrap = ForagaxObjectEnv(
|
473
|
+
size=(7, 7), aperture_size=(3, 3), objects=object_types, nowrap=True
|
474
|
+
)
|
475
|
+
params = env_no_wrap.default_params
|
476
|
+
|
477
|
+
# Place a flower at the opposite corner (6,6)
|
478
|
+
grid = jnp.zeros((7, 7), dtype=int)
|
479
|
+
grid = grid.at[6, 6].set(1) # FLOWER
|
480
|
+
|
481
|
+
# Agent at (0,0)
|
482
|
+
state = env_no_wrap.reset(key, params)[1]
|
483
|
+
state = state.replace(object_grid=grid, pos=jnp.array([0, 0]))
|
484
|
+
|
485
|
+
# With no wrapping, should not see the flower, see padding
|
486
|
+
obs_no_wrap = env_no_wrap.get_obs(state, params)
|
487
|
+
assert env_no_wrap.num_color_channels == 2 # Flower + padding
|
488
|
+
# Check that padding channel is activated for out of bound positions
|
489
|
+
padding_mask = jnp.array(
|
490
|
+
[
|
491
|
+
[1, 1, 1],
|
492
|
+
[1, 0, 0],
|
493
|
+
[1, 0, 0],
|
494
|
+
],
|
495
|
+
dtype=bool,
|
496
|
+
)
|
497
|
+
assert jnp.all(obs_no_wrap[padding_mask, 1] == 1)
|
498
|
+
# And flower not visible
|
499
|
+
assert jnp.all(obs_no_wrap[:, :, 0] == 0)
|
500
|
+
|
501
|
+
|
411
502
|
def test_generate_objects_in_biome():
|
412
503
|
"""Test generating objects within a specific biome area."""
|
413
504
|
object_types = (WALL, FLOWER, THORNS, MOREL, OYSTER)
|
File without changes
|
File without changes
|
{continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/continual_foragax.egg-info/SOURCES.txt
RENAMED
File without changes
|
File without changes
|
File without changes
|
{continual_foragax-0.11.0 → continual_foragax-0.12.0}/src/continual_foragax.egg-info/requires.txt
RENAMED
File without changes
|
{continual_foragax-0.11.0 → continual_foragax-0.12.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
|