latent_sokoban.env¶
latent_sokoban.env
¶
Deterministic Sokoban environment operating on symbolic state.
The symbolic state exists only inside the environment, the solver and the evaluation harness. Agents never see it: they receive rendered images only (see the "Allowed Inputs" section of the competition rules).
Actions: 0 = up, 1 = down, 2 = left, 3 = right. Invalid actions (walking into a wall, pushing a blocked box) are no-ops that still consume a step.
ASCII level format (standard Sokoban notation): # wall . goal (space) floor $ box @ player * box on goal + player on goal
Level
dataclass
¶
Immutable level definition.
Source code in latent_sokoban/env.py
SokobanState
dataclass
¶
Mutable dynamic state on top of a fixed Level.
Source code in latent_sokoban/env.py
SokobanEnv
¶
Deterministic Sokoban with a fixed step limit.
Source code in latent_sokoban/env.py
116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 | |
goal_state
¶
The target configuration: all boxes on goals. The player position in the goal image is undefined; by convention we omit the player when rendering goal observations (render(..., show_player=False)).
Source code in latent_sokoban/env.py
step
¶
Apply one action. Returns (state, done, info).
done is True when the puzzle is solved or the step limit is reached. Invalid actions are no-op transitions that still consume a step.
Source code in latent_sokoban/env.py
apply
staticmethod
¶
Pure transition on a state key ((player, boxes)) for search.