Skip to content

Commit

Permalink
revert xland time limit, new env regs
Browse files Browse the repository at this point in the history
  • Loading branch information
Howuhh committed May 5, 2024
1 parent 7035b29 commit ed037b7
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 1 deletion.
48 changes: 48 additions & 0 deletions src/xminigrid/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,14 @@
width=9,
)

register(
id="XLand-MiniGrid-R1-11x11",
entry_point="xminigrid.envs.xland:XLandMiniGrid",
grid_type="R1",
height=11,
width=11,
)

register(
id="XLand-MiniGrid-R1-13x13",
entry_point="xminigrid.envs.xland:XLandMiniGrid",
Expand All @@ -98,6 +106,14 @@
width=13,
)

register(
id="XLand-MiniGrid-R1-15x15",
entry_point="xminigrid.envs.xland:XLandMiniGrid",
grid_type="R1",
height=15,
width=15,
)

register(
id="XLand-MiniGrid-R1-17x17",
entry_point="xminigrid.envs.xland:XLandMiniGrid",
Expand All @@ -115,6 +131,14 @@
width=9,
)

register(
id="XLand-MiniGrid-R2-11x11",
entry_point="xminigrid.envs.xland:XLandMiniGrid",
grid_type="R2",
height=11,
width=11,
)

register(
id="XLand-MiniGrid-R2-13x13",
entry_point="xminigrid.envs.xland:XLandMiniGrid",
Expand All @@ -123,6 +147,14 @@
width=13,
)

register(
id="XLand-MiniGrid-R2-15x15",
entry_point="xminigrid.envs.xland:XLandMiniGrid",
grid_type="R2",
height=15,
width=15,
)

register(
id="XLand-MiniGrid-R2-17x17",
entry_point="xminigrid.envs.xland:XLandMiniGrid",
Expand All @@ -140,6 +172,14 @@
width=9,
)

register(
id="XLand-MiniGrid-R4-11x11",
entry_point="xminigrid.envs.xland:XLandMiniGrid",
grid_type="R4",
height=11,
width=11,
)

register(
id="XLand-MiniGrid-R4-13x13",
entry_point="xminigrid.envs.xland:XLandMiniGrid",
Expand All @@ -148,6 +188,14 @@
width=13,
)

register(
id="XLand-MiniGrid-R4-15x15",
entry_point="xminigrid.envs.xland:XLandMiniGrid",
grid_type="R4",
height=15,
width=15,
)

register(
id="XLand-MiniGrid-R4-17x17",
entry_point="xminigrid.envs.xland:XLandMiniGrid",
Expand Down
2 changes: 1 addition & 1 deletion src/xminigrid/envs/xland.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ def default_params(self, **kwargs) -> XLandEnvParams:
# this is just a heuristic to prevent brute force in one episode,
# so that agent need to remember what he tried in previous episodes.
# If this is too small, change it or increase number of trials (NB: these are not equivalent).
params = params.replace(max_steps=4 * (params.height * params.width))
params = params.replace(max_steps=3 * (params.height * params.width))
return params

def _generate_problem(self, params: XLandEnvParams, key: jax.Array) -> State[EnvCarry]:
Expand Down

0 comments on commit ed037b7

Please sign in to comment.