miniworld-maze 1.0.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.
Potentially problematic release.
This version of miniworld-maze might be problematic. Click here for more details.
- miniworld_maze/__init__.py +37 -0
- miniworld_maze/core/__init__.py +8 -0
- miniworld_maze/core/constants.py +130 -0
- miniworld_maze/core/miniworld_gymnasium/README.md +1 -0
- miniworld_maze/core/miniworld_gymnasium/__init__.py +4 -0
- miniworld_maze/core/miniworld_gymnasium/base_env.py +52 -0
- miniworld_maze/core/miniworld_gymnasium/entities/__init__.py +7 -0
- miniworld_maze/core/miniworld_gymnasium/entities/agent.py +117 -0
- miniworld_maze/core/miniworld_gymnasium/entities/base_entity.py +135 -0
- miniworld_maze/core/miniworld_gymnasium/entities/objects.py +116 -0
- miniworld_maze/core/miniworld_gymnasium/entity_manager.py +358 -0
- miniworld_maze/core/miniworld_gymnasium/envs/__init__.py +3 -0
- miniworld_maze/core/miniworld_gymnasium/math.py +83 -0
- miniworld_maze/core/miniworld_gymnasium/objmesh.py +294 -0
- miniworld_maze/core/miniworld_gymnasium/occlusion_queries.py +97 -0
- miniworld_maze/core/miniworld_gymnasium/opengl.py +21 -0
- miniworld_maze/core/miniworld_gymnasium/params.py +128 -0
- miniworld_maze/core/miniworld_gymnasium/random.py +105 -0
- miniworld_maze/core/miniworld_gymnasium/rendering/__init__.py +7 -0
- miniworld_maze/core/miniworld_gymnasium/rendering/drawing.py +77 -0
- miniworld_maze/core/miniworld_gymnasium/rendering/framebuffer.py +260 -0
- miniworld_maze/core/miniworld_gymnasium/rendering/texture.py +101 -0
- miniworld_maze/core/miniworld_gymnasium/rendering_engine.py +293 -0
- miniworld_maze/core/miniworld_gymnasium/room.py +330 -0
- miniworld_maze/core/miniworld_gymnasium/texture_utils.py +64 -0
- miniworld_maze/core/miniworld_gymnasium/textures/airduct_grate_1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/asphalt_1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/beanpaste_1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/beige_1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/black_1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/blueberry_1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/brick_wall_1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/cardboard_1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/cardboard_2.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/cardboard_3.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/cardboard_4.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/ceiling_tile_noborder_1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/ceiling_tiles_1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/cinder_blocks_1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/cobaltgreen_1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/concrete_1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/concrete_2.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/concrete_3.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/concrete_4.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/concrete_tiles_1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/copperred_1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/crimson_1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/door_doom_1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/door_doom_2.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/door_garage_red.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/door_garage_white.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/door_steel_brown.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/door_steel_grey.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/door_steel_red.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/drywall_1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/floor_tiles_bw_1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/floor_tiles_white.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/grass_1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/grass_2.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/lava_1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/lava_2.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/lemongrass_1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/lightbeige_1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/lightcobaltgreen_1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/lightgray_1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/lightnavyblue_1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/lightskyblue_1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/lime_1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/logo_mila_1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/magenta_1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/marble_1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/marble_2.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/metal_grill_1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/metal_grill_2.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/morningglory_1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/navyblue_1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/oakbrown_1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/orange_1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/orchid_1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/picket_fence_1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/adelaide_hanscom1.license +2 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/adelaide_hanscom1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/alessandro_allori1.license +2 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/alessandro_allori1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/alessandro_allori2.license +2 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/alessandro_allori2.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/alexandre_cabanel1.license +2 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/alexandre_cabanel1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/alexei_harlamov1.license +2 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/alexei_harlamov1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/alexey_petrovich_antropov1.license +2 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/alexey_petrovich_antropov1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/alice_pike_barney1.license +2 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/alice_pike_barney1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/aman_theodor1.license +2 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/aman_theodor1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/antonello_messina1.license +2 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/antonello_messina1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/antonio_herrera_toro1.license +2 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/antonio_herrera_toro1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/benjamin-constant1.license +2 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/benjamin-constant1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/benoist_marie-guillemine1.license +2 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/benoist_marie-guillemine1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/bouguereau_william-adolphe1.license +2 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/bouguereau_william-adolphe1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/byron1.license +2 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/byron1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/carl_fredric_breda1.license +2 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/carl_fredric_breda1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/carl_fredric_breda2.license +2 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/carl_fredric_breda2.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/cramacj_lucas1.license +2 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/cramacj_lucas1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/cranach_lucas2.license +2 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/cranach_lucas2.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/cristobal_rojas1.license +2 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/cristobal_rojas1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/delacroix_eugene_ferdinand_victor1.license +2 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/delacroix_eugene_ferdinand_victor1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/domenikos_theotokopoulos1.license +2 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/domenikos_theotokopoulos1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/edmund_blair_leighton1.license +2 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/edmund_blair_leighton1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/edmund_blair_leighton2.license +2 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/edmund_blair_leighton2.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/edwin_longsden_long1.license +2 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/edwin_longsden_long1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/falero_luis_ricardo1.license +2 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/falero_luis_ricardo1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/felix_bonfils1.license +2 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/felix_bonfils1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/francesco_hayez1.license +2 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/francesco_hayez1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/francisco_goya_lucientes1.license +2 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/francisco_goya_lucientes1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/francisco_goya_lucientes2.license +2 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/francisco_goya_lucientes2.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/francisco_zurbaran1.license +2 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/francisco_zurbaran1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/franz_von_defregger1.license +2 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/franz_von_defregger1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/franz_von_defregger2.license +2 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/franz_von_defregger2.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/franz_von_defregger3.license +2 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/franz_von_defregger3.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/frederic_westin1.license +2 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/frederic_westin1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/frederic_yates1.license +2 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/frederic_yates1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/frederick_leighton1.license +2 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/frederick_leighton1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/gaston_bussiere1.license +2 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/gaston_bussiere1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/george_henry_hall1.license +2 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/george_henry_hall1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/giovanni_battista_tiepolo1.license +2 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/giovanni_battista_tiepolo1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/giovanni_bellini1.license +2 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/giovanni_bellini1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/hans_holbein1.license +2 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/hans_holbein1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/hayez_francesco1.license +2 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/hayez_francesco1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/henryk_siemiradzki1.license +2 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/henryk_siemiradzki1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/ilja_jefimowitsch_repin1.license +2 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/ilja_jefimowitsch_repin1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/james_carrol_beckwith1.license +2 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/james_carrol_beckwith1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/jean-baptiste-camille_corot1.license +2 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/jean-baptiste-camille_corot1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/jean-baptiste-camille_corot2.license +2 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/jean-baptiste-camille_corot2.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/jean-leon_gerome1.license +2 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/jean-leon_gerome1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/jean-leon_gerome2.license +2 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/jean-leon_gerome2.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/jean-leon_gerome3.license +2 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/jean-leon_gerome3.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/jean-leon_gerome4.license +2 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/jean-leon_gerome4.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/john_william_godward1.license +2 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/john_william_godward1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/john_william_godward2.license +2 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/john_william_godward2.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/john_william_godward3.license +2 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/john_william_godward3.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/julije_klovic1.license +2 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/julije_klovic1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/juriaen_streek1.license +2 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/juriaen_streek1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/kiprenskij_orest_adamovic1.license +2 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/kiprenskij_orest_adamovic1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/konstantin_makovsky1.license +2 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/konstantin_makovsky1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/lefebvre_jules_joseph1.license +2 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/lefebvre_jules_joseph1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/leon-francois_comerre1.license +2 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/leon-francois_comerre1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/leopold_loffler1.license +2 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/leopold_loffler1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/lewis_john_frederick1.license +2 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/lewis_john_frederick1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/madrazo_garreta_raimundo1.license +2 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/madrazo_garreta_raimundo1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/marie_bashkirtseff1.license +2 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/marie_bashkirtseff1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/moritz_kellerhoven1.license +2 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/moritz_kellerhoven1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/nathaniel_jocelyn1.license +2 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/nathaniel_jocelyn1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/nikolai_alexandrowitsch_jaroschenko1.license +2 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/nikolai_alexandrowitsch_jaroschenko1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/nils_johan_olsson_blommer1.license +2 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/nils_johan_olsson_blommer1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/paolo_veronese1.license +2 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/paolo_veronese1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/parmigianino1.license +2 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/parmigianino1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/paul_cesar_helleu1.license +2 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/paul_cesar_helleu1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/regnault_henri1.license +2 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/regnault_henri1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/richard_bergh1.license +2 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/richard_bergh1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/richard_bergh2.license +2 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/richard_bergh2.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/robert_dampier1.license +2 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/robert_dampier1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/robert_lefevre1.license +2 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/robert_lefevre1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/robert_leopold1.license +2 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/robert_leopold1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/sichel_nathanael1.license +2 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/sichel_nathanael1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/svetoslav_roerich1.license +2 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/svetoslav_roerich1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/velazquez_diego1.license +2 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/velazquez_diego1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/viktor_vasnetsov1.license +2 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/viktor_vasnetsov1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/william-adolphe_bouguereau1.license +2 -0
- miniworld_maze/core/miniworld_gymnasium/textures/portraits/william-adolphe_bouguereau1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/realblueberry_1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/redbean_1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/rock_1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/seablue_1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/silver_1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/skyblue_1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/slime_1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/stucco_1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/sunnyyellow_1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/turquoise_1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/violet_1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/water_1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/water_2.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/water_3.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/white_1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/wood_1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/wood_2.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/textures/wood_planks_1.png +0 -0
- miniworld_maze/core/miniworld_gymnasium/unified_env.py +1364 -0
- miniworld_maze/core/miniworld_gymnasium/utils.py +37 -0
- miniworld_maze/core/miniworld_gymnasium/wrappers.py +2 -0
- miniworld_maze/core/observation_types.py +32 -0
- miniworld_maze/environments/__init__.py +16 -0
- miniworld_maze/environments/base_grid_rooms.py +204 -0
- miniworld_maze/environments/factory.py +155 -0
- miniworld_maze/environments/nine_rooms.py +74 -0
- miniworld_maze/environments/spiral_nine_rooms.py +70 -0
- miniworld_maze/environments/twenty_five_rooms.py +122 -0
- miniworld_maze/tools/__init__.py +5 -0
- miniworld_maze/tools/generate_observations.py +199 -0
- miniworld_maze/wrappers/__init__.py +5 -0
- miniworld_maze/wrappers/image_transforms.py +40 -0
- miniworld_maze-1.0.0.dist-info/METADATA +108 -0
- miniworld_maze-1.0.0.dist-info/RECORD +280 -0
- miniworld_maze-1.0.0.dist-info/WHEEL +4 -0
- miniworld_maze-1.0.0.dist-info/entry_points.txt +3 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import os
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
def get_subdir_path(sub_dir):
|
|
5
|
+
# Get the directory this module is located in
|
|
6
|
+
abs_path_module = os.path.realpath(__file__)
|
|
7
|
+
module_dir, _ = os.path.split(abs_path_module)
|
|
8
|
+
|
|
9
|
+
dir_path = os.path.join(module_dir, sub_dir)
|
|
10
|
+
|
|
11
|
+
return dir_path
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def get_file_path(sub_dir, file_name, default_ext):
|
|
15
|
+
"""
|
|
16
|
+
Get the absolute path of a resource file, which may be relative to
|
|
17
|
+
the gym_duckietown module directory, or an absolute path.
|
|
18
|
+
|
|
19
|
+
This function is necessary because the simulator may be imported by
|
|
20
|
+
other packages, and we need to be able to load resources no matter
|
|
21
|
+
what the current working directory is.
|
|
22
|
+
"""
|
|
23
|
+
|
|
24
|
+
assert "." not in default_ext
|
|
25
|
+
assert "/" not in default_ext
|
|
26
|
+
|
|
27
|
+
# If this is already a real path
|
|
28
|
+
if os.path.exists(file_name):
|
|
29
|
+
return file_name
|
|
30
|
+
|
|
31
|
+
subdir_path = get_subdir_path(sub_dir)
|
|
32
|
+
file_path = os.path.join(subdir_path, file_name)
|
|
33
|
+
|
|
34
|
+
if "." not in file_name:
|
|
35
|
+
file_path += "." + default_ext
|
|
36
|
+
|
|
37
|
+
return file_path
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"""Observation type definitions for Nine Rooms environments."""
|
|
2
|
+
|
|
3
|
+
from enum import IntEnum
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class ObservationLevel(IntEnum):
|
|
7
|
+
"""Defines the different observation levels available in the environments.
|
|
8
|
+
|
|
9
|
+
Each level provides a different perspective and amount of information:
|
|
10
|
+
- TOP_DOWN_PARTIAL: Agent-centered partial top-down view (POMDP)
|
|
11
|
+
- TOP_DOWN_FULL: Complete environment top-down view
|
|
12
|
+
- FIRST_PERSON: 3D first-person view from agent's perspective
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
TOP_DOWN_PARTIAL = 1 # Top-down POMDP view (agent-centered, limited range)
|
|
16
|
+
TOP_DOWN_FULL = 2 # Full top-down view of entire environment
|
|
17
|
+
FIRST_PERSON = 3 # First-person 3D view from agent's perspective
|
|
18
|
+
|
|
19
|
+
def __str__(self):
|
|
20
|
+
"""Return descriptive string representation."""
|
|
21
|
+
names = {1: "TOP_DOWN_PARTIAL", 2: "TOP_DOWN_FULL", 3: "FIRST_PERSON"}
|
|
22
|
+
return names[self.value]
|
|
23
|
+
|
|
24
|
+
@property
|
|
25
|
+
def description(self):
|
|
26
|
+
"""Return detailed description of this observation level."""
|
|
27
|
+
descriptions = {
|
|
28
|
+
1: "Agent-centered partial top-down view with limited visibility range",
|
|
29
|
+
2: "Complete top-down view showing the entire environment",
|
|
30
|
+
3: "First-person 3D perspective view from the agent's current position",
|
|
31
|
+
}
|
|
32
|
+
return descriptions[self.value]
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"""Nine Rooms environment implementations."""
|
|
2
|
+
|
|
3
|
+
from .base_grid_rooms import GridRoomsEnvironment
|
|
4
|
+
from .factory import NineRoomsEnvironmentWrapper, create_nine_rooms_env
|
|
5
|
+
from .nine_rooms import NineRooms
|
|
6
|
+
from .spiral_nine_rooms import SpiralNineRooms
|
|
7
|
+
from .twenty_five_rooms import TwentyFiveRooms
|
|
8
|
+
|
|
9
|
+
__all__ = [
|
|
10
|
+
"GridRoomsEnvironment",
|
|
11
|
+
"create_nine_rooms_env",
|
|
12
|
+
"NineRoomsEnvironmentWrapper",
|
|
13
|
+
"NineRooms",
|
|
14
|
+
"SpiralNineRooms",
|
|
15
|
+
"TwentyFiveRooms",
|
|
16
|
+
]
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
"""Base Grid Rooms environment implementation."""
|
|
2
|
+
|
|
3
|
+
from typing import List, Optional, Tuple, Union
|
|
4
|
+
|
|
5
|
+
from gymnasium import spaces
|
|
6
|
+
|
|
7
|
+
from ..core import COLORS, Box, ObservationLevel
|
|
8
|
+
from ..core.constants import (
|
|
9
|
+
AGENT_START_POSITION,
|
|
10
|
+
BOX_GRID_SIZE,
|
|
11
|
+
BOX_OFFSET_FRACTION,
|
|
12
|
+
BOX_SIZE_FRACTION,
|
|
13
|
+
BOXES_PER_ROOM,
|
|
14
|
+
DEFAULT_DOOR_SIZE,
|
|
15
|
+
DEFAULT_OBS_HEIGHT,
|
|
16
|
+
DEFAULT_OBS_WIDTH,
|
|
17
|
+
DEFAULT_ROOM_SIZE,
|
|
18
|
+
MAX_EPISODE_STEPS,
|
|
19
|
+
ROOM_BOUNDARY_MARGIN,
|
|
20
|
+
ROOM_CENTER_FRACTION,
|
|
21
|
+
)
|
|
22
|
+
from ..core.miniworld_gymnasium.unified_env import UnifiedMiniWorldEnv
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class GridRoomsEnvironment(UnifiedMiniWorldEnv):
|
|
26
|
+
"""
|
|
27
|
+
Base class for grid-based room environments.
|
|
28
|
+
|
|
29
|
+
Supports different grid sizes and connection patterns.
|
|
30
|
+
Subclasses pass their specific configurations directly to __init__.
|
|
31
|
+
"""
|
|
32
|
+
|
|
33
|
+
def __init__(
|
|
34
|
+
self,
|
|
35
|
+
grid_size: int,
|
|
36
|
+
connections: List[Tuple[int, int]],
|
|
37
|
+
textures: List[str],
|
|
38
|
+
placed_room: Optional[int] = None,
|
|
39
|
+
obs_level: ObservationLevel = ObservationLevel.TOP_DOWN_PARTIAL,
|
|
40
|
+
continuous: bool = False,
|
|
41
|
+
room_size: Union[int, float] = DEFAULT_ROOM_SIZE,
|
|
42
|
+
door_size: Union[int, float] = DEFAULT_DOOR_SIZE,
|
|
43
|
+
agent_mode: Optional[str] = None,
|
|
44
|
+
obs_width: int = DEFAULT_OBS_WIDTH,
|
|
45
|
+
obs_height: int = DEFAULT_OBS_HEIGHT,
|
|
46
|
+
**kwargs,
|
|
47
|
+
):
|
|
48
|
+
"""
|
|
49
|
+
Initialize a grid-based room environment.
|
|
50
|
+
|
|
51
|
+
Args:
|
|
52
|
+
grid_size: Size of the grid (e.g., 3 for 3x3 grid)
|
|
53
|
+
connections: List of (room1, room2) tuples for connections
|
|
54
|
+
textures: List of texture names for each room
|
|
55
|
+
placed_room: Initial room index (defaults to 0)
|
|
56
|
+
obs_level: Observation level (defaults to 1)
|
|
57
|
+
continuous: Whether to use continuous actions (defaults to False)
|
|
58
|
+
room_size: Size of each room in environment units (defaults to 5)
|
|
59
|
+
door_size: Size of doors between rooms (defaults to 2)
|
|
60
|
+
agent_mode: Agent rendering mode ('triangle', 'circle', 'empty')
|
|
61
|
+
obs_width: Observation width in pixels (defaults to DEFAULT_OBS_WIDTH)
|
|
62
|
+
obs_height: Observation height in pixels (defaults to DEFAULT_OBS_HEIGHT)
|
|
63
|
+
**kwargs: Additional arguments passed to parent class
|
|
64
|
+
"""
|
|
65
|
+
|
|
66
|
+
# Set grid configuration
|
|
67
|
+
self.grid_size = grid_size
|
|
68
|
+
self.total_rooms = self.grid_size * self.grid_size
|
|
69
|
+
|
|
70
|
+
# Validate and set connections
|
|
71
|
+
assert len(connections) > 0, "Connection between rooms should be more than 1"
|
|
72
|
+
self.connections = connections
|
|
73
|
+
|
|
74
|
+
# Validate and set textures
|
|
75
|
+
assert len(textures) == self.total_rooms, (
|
|
76
|
+
f"Textures for floor should be same as the number of the rooms ({self.total_rooms})"
|
|
77
|
+
)
|
|
78
|
+
self.textures = textures
|
|
79
|
+
|
|
80
|
+
# Set placed room
|
|
81
|
+
if placed_room is None:
|
|
82
|
+
self.placed_room = 0 # Start in the first room
|
|
83
|
+
else:
|
|
84
|
+
assert 0 <= placed_room < self.total_rooms, (
|
|
85
|
+
f"placing point should be in 0~{self.total_rooms - 1}"
|
|
86
|
+
)
|
|
87
|
+
self.placed_room = placed_room
|
|
88
|
+
|
|
89
|
+
# Set agent mode
|
|
90
|
+
if agent_mode is None:
|
|
91
|
+
self.agent_mode = "empty"
|
|
92
|
+
else:
|
|
93
|
+
assert agent_mode in ["triangle", "circle", "empty"], (
|
|
94
|
+
"configuration cannot be done"
|
|
95
|
+
)
|
|
96
|
+
self.agent_mode = agent_mode
|
|
97
|
+
|
|
98
|
+
self.room_size = room_size
|
|
99
|
+
self.door_size = door_size
|
|
100
|
+
|
|
101
|
+
# Mark this as a custom environment for background color handling
|
|
102
|
+
self._is_custom_env = True
|
|
103
|
+
|
|
104
|
+
super().__init__(
|
|
105
|
+
obs_level=obs_level,
|
|
106
|
+
max_episode_steps=MAX_EPISODE_STEPS,
|
|
107
|
+
continuous=continuous,
|
|
108
|
+
agent_mode=self.agent_mode,
|
|
109
|
+
obs_width=obs_width,
|
|
110
|
+
obs_height=obs_height,
|
|
111
|
+
**kwargs,
|
|
112
|
+
)
|
|
113
|
+
|
|
114
|
+
if not self.continuous:
|
|
115
|
+
self.action_space = spaces.Discrete(self.actions.move_forward + 1)
|
|
116
|
+
|
|
117
|
+
def _generate_world_layout(self, pos=None):
|
|
118
|
+
rooms = []
|
|
119
|
+
|
|
120
|
+
# Create rooms in grid layout
|
|
121
|
+
for i in range(self.grid_size):
|
|
122
|
+
for j in range(self.grid_size):
|
|
123
|
+
rooms.append(
|
|
124
|
+
self.add_rect_room(
|
|
125
|
+
min_x=self.room_size * j,
|
|
126
|
+
max_x=self.room_size * (j + (1 - ROOM_BOUNDARY_MARGIN)),
|
|
127
|
+
min_z=self.room_size * i,
|
|
128
|
+
max_z=self.room_size * (i + (1 - ROOM_BOUNDARY_MARGIN)),
|
|
129
|
+
floor_tex=self.textures[self.grid_size * i + j],
|
|
130
|
+
)
|
|
131
|
+
)
|
|
132
|
+
|
|
133
|
+
# Connect rooms based on connection list
|
|
134
|
+
for connection in self.connections:
|
|
135
|
+
if rooms[connection[0]].mid_x == rooms[connection[1]].mid_x:
|
|
136
|
+
self.connect_rooms(
|
|
137
|
+
rooms[connection[0]],
|
|
138
|
+
rooms[connection[1]],
|
|
139
|
+
min_x=rooms[connection[0]].mid_x - self.door_size,
|
|
140
|
+
max_x=rooms[connection[0]].mid_x + self.door_size,
|
|
141
|
+
)
|
|
142
|
+
else:
|
|
143
|
+
self.connect_rooms(
|
|
144
|
+
rooms[connection[0]],
|
|
145
|
+
rooms[connection[1]],
|
|
146
|
+
min_z=rooms[connection[0]].mid_z - self.door_size,
|
|
147
|
+
max_z=rooms[connection[0]].mid_z + self.door_size,
|
|
148
|
+
)
|
|
149
|
+
|
|
150
|
+
# Place agent
|
|
151
|
+
if pos is None:
|
|
152
|
+
self.place_agent(pos=list(AGENT_START_POSITION))
|
|
153
|
+
else:
|
|
154
|
+
self.place_agent(pos=[pos[0], 0, pos[1]])
|
|
155
|
+
|
|
156
|
+
# Place box entities in each room in a 3x3 grid pattern
|
|
157
|
+
self._place_room_boxes()
|
|
158
|
+
|
|
159
|
+
def _place_room_boxes(self):
|
|
160
|
+
"""Place colored box entities in each room using a 3x3 grid pattern."""
|
|
161
|
+
available_colors = list(COLORS.keys())
|
|
162
|
+
num_colors = len(available_colors)
|
|
163
|
+
|
|
164
|
+
for room_row in range(self.grid_size):
|
|
165
|
+
for room_col in range(self.grid_size):
|
|
166
|
+
room_start_x = self.room_size * room_col
|
|
167
|
+
room_start_z = self.room_size * room_row
|
|
168
|
+
|
|
169
|
+
# Place boxes in a 3x3 grid within each room
|
|
170
|
+
for box_index in range(BOXES_PER_ROOM):
|
|
171
|
+
box_row = box_index // BOX_GRID_SIZE
|
|
172
|
+
box_col = box_index % BOX_GRID_SIZE
|
|
173
|
+
|
|
174
|
+
# Calculate unique color index for variety
|
|
175
|
+
color_index = (
|
|
176
|
+
box_index + 1 + (room_row + 1) * (room_col + 1)
|
|
177
|
+
) % num_colors
|
|
178
|
+
box_color = available_colors[color_index]
|
|
179
|
+
|
|
180
|
+
# Calculate box position within room
|
|
181
|
+
box_x = (
|
|
182
|
+
room_start_x
|
|
183
|
+
+ ROOM_CENTER_FRACTION * self.room_size * box_col
|
|
184
|
+
+ BOX_OFFSET_FRACTION * self.room_size
|
|
185
|
+
)
|
|
186
|
+
box_z = (
|
|
187
|
+
room_start_z
|
|
188
|
+
+ ROOM_CENTER_FRACTION * self.room_size * box_row
|
|
189
|
+
+ BOX_OFFSET_FRACTION * self.room_size
|
|
190
|
+
)
|
|
191
|
+
|
|
192
|
+
# Create and place the box
|
|
193
|
+
box = Box(
|
|
194
|
+
color=box_color,
|
|
195
|
+
transparentable=True,
|
|
196
|
+
size=BOX_SIZE_FRACTION * self.room_size,
|
|
197
|
+
static=True,
|
|
198
|
+
)
|
|
199
|
+
|
|
200
|
+
self.place_entity(ent=box, pos=[box_x, 0, box_z], dir=0)
|
|
201
|
+
|
|
202
|
+
def step(self, action):
|
|
203
|
+
obs, reward, terminated, truncated, info = super().step(action)
|
|
204
|
+
return obs, reward, terminated, truncated, info
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
"""Factory for creating Nine Rooms environment variants."""
|
|
2
|
+
|
|
3
|
+
import gymnasium as gym
|
|
4
|
+
import numpy as np
|
|
5
|
+
|
|
6
|
+
from ..core import ObservationLevel
|
|
7
|
+
from ..core.constants import FACTORY_DOOR_SIZE, FACTORY_ROOM_SIZE
|
|
8
|
+
from ..wrappers.image_transforms import ImageToPyTorch
|
|
9
|
+
from .nine_rooms import NineRooms
|
|
10
|
+
from .spiral_nine_rooms import SpiralNineRooms
|
|
11
|
+
from .twenty_five_rooms import TwentyFiveRooms
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class NineRoomsEnvironmentWrapper(gym.Wrapper):
|
|
15
|
+
"""Unified wrapper for all Nine Rooms environment variants."""
|
|
16
|
+
|
|
17
|
+
def __init__(
|
|
18
|
+
self,
|
|
19
|
+
variant="NineRooms",
|
|
20
|
+
obs_level=ObservationLevel.TOP_DOWN_PARTIAL,
|
|
21
|
+
continuous=False,
|
|
22
|
+
size=64,
|
|
23
|
+
room_size=FACTORY_ROOM_SIZE,
|
|
24
|
+
door_size=FACTORY_DOOR_SIZE,
|
|
25
|
+
agent_mode=None,
|
|
26
|
+
):
|
|
27
|
+
"""
|
|
28
|
+
Create a Nine Rooms environment variant.
|
|
29
|
+
|
|
30
|
+
Args:
|
|
31
|
+
variant: Environment variant ("NineRooms", "SpiralNineRooms", "TwentyFiveRooms")
|
|
32
|
+
obs_level: Observation level (ObservationLevel enum)
|
|
33
|
+
continuous: Whether to use continuous actions
|
|
34
|
+
size: Observation image size (rendered directly at this size to avoid resizing)
|
|
35
|
+
room_size: Size of each room in environment units
|
|
36
|
+
door_size: Size of doors between rooms
|
|
37
|
+
agent_mode: Agent rendering mode ('empty', 'circle', 'triangle', or None for default)
|
|
38
|
+
"""
|
|
39
|
+
self.variant = variant
|
|
40
|
+
|
|
41
|
+
# Select the appropriate environment class
|
|
42
|
+
env_classes = {
|
|
43
|
+
"NineRooms": NineRooms,
|
|
44
|
+
"SpiralNineRooms": SpiralNineRooms,
|
|
45
|
+
"TwentyFiveRooms": TwentyFiveRooms,
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
if variant not in env_classes:
|
|
49
|
+
raise ValueError(
|
|
50
|
+
f"Unknown variant '{variant}'. Available: {list(env_classes.keys())}"
|
|
51
|
+
)
|
|
52
|
+
|
|
53
|
+
env_class = env_classes[variant]
|
|
54
|
+
|
|
55
|
+
# Create base environment with direct rendering size
|
|
56
|
+
base_env = env_class(
|
|
57
|
+
room_size=room_size,
|
|
58
|
+
door_size=door_size,
|
|
59
|
+
obs_level=obs_level,
|
|
60
|
+
continuous=continuous,
|
|
61
|
+
obs_width=size,
|
|
62
|
+
obs_height=size,
|
|
63
|
+
agent_mode=agent_mode,
|
|
64
|
+
)
|
|
65
|
+
|
|
66
|
+
# Apply wrappers - no resize needed since we render at target size
|
|
67
|
+
env = ImageToPyTorch(base_env)
|
|
68
|
+
|
|
69
|
+
# Initialize gym.Wrapper with the wrapped environment
|
|
70
|
+
super().__init__(env)
|
|
71
|
+
|
|
72
|
+
def render_on_pos(self, pos):
|
|
73
|
+
"""Render observation from a specific position."""
|
|
74
|
+
# Get access to the base environment
|
|
75
|
+
base_env = self.env
|
|
76
|
+
while hasattr(base_env, "env") or hasattr(base_env, "_env"):
|
|
77
|
+
if hasattr(base_env, "env"):
|
|
78
|
+
base_env = base_env.env
|
|
79
|
+
elif hasattr(base_env, "_env"):
|
|
80
|
+
base_env = base_env._env
|
|
81
|
+
else:
|
|
82
|
+
break
|
|
83
|
+
|
|
84
|
+
# Store original position
|
|
85
|
+
original_pos = base_env.agent.pos.copy()
|
|
86
|
+
|
|
87
|
+
# Move agent to target position
|
|
88
|
+
base_env.place_agent(pos=pos)
|
|
89
|
+
|
|
90
|
+
# Get first-person observation from the agent's perspective at this position
|
|
91
|
+
obs = base_env.render_obs()
|
|
92
|
+
|
|
93
|
+
# Restore original position
|
|
94
|
+
base_env.place_agent(pos=original_pos)
|
|
95
|
+
|
|
96
|
+
# Apply wrapper transformations manually for consistency
|
|
97
|
+
# Convert to PyTorch format (CHW) - no resize needed since we render at target size
|
|
98
|
+
obs = np.transpose(obs, (2, 0, 1))
|
|
99
|
+
|
|
100
|
+
return obs
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
def create_drstrategy_env(variant="NineRooms", **kwargs):
|
|
104
|
+
"""
|
|
105
|
+
Factory function to create DrStrategy environment variants.
|
|
106
|
+
|
|
107
|
+
Args:
|
|
108
|
+
variant: Environment variant ("NineRooms", "SpiralNineRooms", "TwentyFiveRooms")
|
|
109
|
+
**kwargs: Additional arguments passed to NineRoomsEnvironmentWrapper
|
|
110
|
+
|
|
111
|
+
Returns:
|
|
112
|
+
NineRoomsEnvironmentWrapper instance
|
|
113
|
+
"""
|
|
114
|
+
return NineRoomsEnvironmentWrapper(variant=variant, **kwargs)
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
# Backward compatibility alias
|
|
118
|
+
def create_nine_rooms_env(variant="NineRooms", **kwargs):
|
|
119
|
+
"""
|
|
120
|
+
Legacy factory function for backward compatibility.
|
|
121
|
+
|
|
122
|
+
Deprecated: Use create_drstrategy_env() instead.
|
|
123
|
+
"""
|
|
124
|
+
import warnings
|
|
125
|
+
|
|
126
|
+
warnings.warn(
|
|
127
|
+
"create_nine_rooms_env() is deprecated. Use create_drstrategy_env() instead.",
|
|
128
|
+
DeprecationWarning,
|
|
129
|
+
stacklevel=2,
|
|
130
|
+
)
|
|
131
|
+
return create_drstrategy_env(variant=variant, **kwargs)
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
# Legacy function - deprecated
|
|
135
|
+
def NineRoomsFullyPureGymnasium(
|
|
136
|
+
name="NineRooms",
|
|
137
|
+
obs_level=ObservationLevel.TOP_DOWN_PARTIAL,
|
|
138
|
+
continuous=False,
|
|
139
|
+
size=64,
|
|
140
|
+
):
|
|
141
|
+
"""
|
|
142
|
+
Legacy function for backward compatibility.
|
|
143
|
+
|
|
144
|
+
Deprecated: Use create_drstrategy_env() instead.
|
|
145
|
+
"""
|
|
146
|
+
import warnings
|
|
147
|
+
|
|
148
|
+
warnings.warn(
|
|
149
|
+
"NineRoomsFullyPureGymnasium() is deprecated. Use create_drstrategy_env() instead.",
|
|
150
|
+
DeprecationWarning,
|
|
151
|
+
stacklevel=2,
|
|
152
|
+
)
|
|
153
|
+
return create_drstrategy_env(
|
|
154
|
+
variant="NineRooms", obs_level=obs_level, continuous=continuous, size=size
|
|
155
|
+
)
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"""NineRooms environment implementation."""
|
|
2
|
+
|
|
3
|
+
from ..core import ObservationLevel
|
|
4
|
+
from .base_grid_rooms import GridRoomsEnvironment
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class NineRooms(GridRoomsEnvironment):
|
|
8
|
+
"""
|
|
9
|
+
Traverse the 9 rooms
|
|
10
|
+
|
|
11
|
+
-------------
|
|
12
|
+
| 0 | 1 | 2 |
|
|
13
|
+
-------------
|
|
14
|
+
| 3 | 4 | 5 |
|
|
15
|
+
-------------
|
|
16
|
+
| 6 | 7 | 8 |
|
|
17
|
+
-------------
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
def __init__(
|
|
21
|
+
self,
|
|
22
|
+
connections=None,
|
|
23
|
+
textures=None,
|
|
24
|
+
placed_room=None,
|
|
25
|
+
obs_level=ObservationLevel.TOP_DOWN_PARTIAL,
|
|
26
|
+
continuous=False,
|
|
27
|
+
room_size=5,
|
|
28
|
+
door_size=2,
|
|
29
|
+
agent_mode=None,
|
|
30
|
+
obs_width=80,
|
|
31
|
+
obs_height=80,
|
|
32
|
+
**kwargs,
|
|
33
|
+
):
|
|
34
|
+
# Default configuration for NineRooms
|
|
35
|
+
default_connections = [
|
|
36
|
+
(0, 1),
|
|
37
|
+
(0, 3),
|
|
38
|
+
(1, 2),
|
|
39
|
+
(1, 4),
|
|
40
|
+
(2, 5),
|
|
41
|
+
(3, 4),
|
|
42
|
+
(3, 6),
|
|
43
|
+
(4, 5),
|
|
44
|
+
(4, 7),
|
|
45
|
+
(5, 8),
|
|
46
|
+
(6, 7),
|
|
47
|
+
(7, 8),
|
|
48
|
+
]
|
|
49
|
+
default_textures = [
|
|
50
|
+
"beige",
|
|
51
|
+
"lightbeige",
|
|
52
|
+
"lightgray",
|
|
53
|
+
"copperred",
|
|
54
|
+
"skyblue",
|
|
55
|
+
"lightcobaltgreen",
|
|
56
|
+
"oakbrown",
|
|
57
|
+
"navyblue",
|
|
58
|
+
"cobaltgreen",
|
|
59
|
+
]
|
|
60
|
+
|
|
61
|
+
super().__init__(
|
|
62
|
+
grid_size=3,
|
|
63
|
+
connections=connections or default_connections,
|
|
64
|
+
textures=textures or default_textures,
|
|
65
|
+
placed_room=placed_room,
|
|
66
|
+
obs_level=obs_level,
|
|
67
|
+
continuous=continuous,
|
|
68
|
+
room_size=room_size,
|
|
69
|
+
door_size=door_size,
|
|
70
|
+
agent_mode=agent_mode,
|
|
71
|
+
obs_width=obs_width,
|
|
72
|
+
obs_height=obs_height,
|
|
73
|
+
**kwargs,
|
|
74
|
+
)
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"""SpiralNineRooms environment implementation."""
|
|
2
|
+
|
|
3
|
+
from ..core import ObservationLevel
|
|
4
|
+
from .base_grid_rooms import GridRoomsEnvironment
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class SpiralNineRooms(GridRoomsEnvironment):
|
|
8
|
+
"""
|
|
9
|
+
Traverse the 9 rooms in spiral
|
|
10
|
+
|
|
11
|
+
-------------
|
|
12
|
+
| 0 | 1 | 2 |
|
|
13
|
+
-------------
|
|
14
|
+
| 3 | 4 | 5 |
|
|
15
|
+
-------------
|
|
16
|
+
| 6 | 7 | 8 |
|
|
17
|
+
-------------
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
def __init__(
|
|
21
|
+
self,
|
|
22
|
+
connections=None,
|
|
23
|
+
textures=None,
|
|
24
|
+
placed_room=None,
|
|
25
|
+
obs_level=ObservationLevel.TOP_DOWN_PARTIAL,
|
|
26
|
+
continuous=False,
|
|
27
|
+
room_size=5,
|
|
28
|
+
door_size=2,
|
|
29
|
+
agent_mode=None,
|
|
30
|
+
obs_width=80,
|
|
31
|
+
obs_height=80,
|
|
32
|
+
**kwargs,
|
|
33
|
+
):
|
|
34
|
+
# Default configuration for SpiralNineRooms
|
|
35
|
+
default_connections = [
|
|
36
|
+
(0, 1),
|
|
37
|
+
(0, 3),
|
|
38
|
+
(1, 2),
|
|
39
|
+
(2, 5),
|
|
40
|
+
(3, 6),
|
|
41
|
+
(4, 5),
|
|
42
|
+
(6, 7),
|
|
43
|
+
(7, 8),
|
|
44
|
+
]
|
|
45
|
+
default_textures = [
|
|
46
|
+
"beige",
|
|
47
|
+
"lightbeige",
|
|
48
|
+
"lightgray",
|
|
49
|
+
"copperred",
|
|
50
|
+
"skyblue",
|
|
51
|
+
"lightcobaltgreen",
|
|
52
|
+
"oakbrown",
|
|
53
|
+
"navyblue",
|
|
54
|
+
"cobaltgreen",
|
|
55
|
+
]
|
|
56
|
+
|
|
57
|
+
super().__init__(
|
|
58
|
+
grid_size=3,
|
|
59
|
+
connections=connections or default_connections,
|
|
60
|
+
textures=textures or default_textures,
|
|
61
|
+
placed_room=placed_room,
|
|
62
|
+
obs_level=obs_level,
|
|
63
|
+
continuous=continuous,
|
|
64
|
+
room_size=room_size,
|
|
65
|
+
door_size=door_size,
|
|
66
|
+
agent_mode=agent_mode,
|
|
67
|
+
obs_width=obs_width,
|
|
68
|
+
obs_height=obs_height,
|
|
69
|
+
**kwargs,
|
|
70
|
+
)
|