Lee93whut commited on
Commit ·
274376b
1
Parent(s): 670449d
style(train): remove forward-reference quotes from type hints (Python 3.10+)
Browse files_sample_connected_start_goal signature used string-quoted annotations
('np.ndarray', 'tuple[int,int]') as a forward-reference workaround.
Python 3.10+ supports built-in generics natively; quotes removed.
- src/train.py +5 -5
src/train.py
CHANGED
|
@@ -173,12 +173,12 @@ def optimize_model(
|
|
| 173 |
# ===========================================================================
|
| 174 |
|
| 175 |
def _sample_connected_start_goal(
|
| 176 |
-
wall_map:
|
| 177 |
grid_size: int,
|
| 178 |
-
rng:
|
| 179 |
-
default_start:
|
| 180 |
-
default_goal:
|
| 181 |
-
) ->
|
| 182 |
"""从 wall_map 的内圈自由格中随机采样一对 BFS 连通的起终点。
|
| 183 |
|
| 184 |
采用有限重试 + fallback 设计,杜绝任何极端地图下的无限循环:
|
|
|
|
| 173 |
# ===========================================================================
|
| 174 |
|
| 175 |
def _sample_connected_start_goal(
|
| 176 |
+
wall_map: np.ndarray,
|
| 177 |
grid_size: int,
|
| 178 |
+
rng: np.random.Generator,
|
| 179 |
+
default_start: tuple[int, int],
|
| 180 |
+
default_goal: tuple[int, int],
|
| 181 |
+
) -> tuple[tuple[int, int], tuple[int, int]]:
|
| 182 |
"""从 wall_map 的内圈自由格中随机采样一对 BFS 连通的起终点。
|
| 183 |
|
| 184 |
采用有限重试 + fallback 设计,杜绝任何极端地图下的无限循环:
|