本文整理汇总了Python中Map.Map.readMap方法的典型用法代码示例。如果您正苦于以下问题:Python Map.readMap方法的具体用法?Python Map.readMap怎么用?Python Map.readMap使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Map.Map
的用法示例。
在下文中一共展示了Map.readMap方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: wasSolved
# 需要导入模块: from Map import Map [as 别名]
# 或者: from Map.Map import readMap [as 别名]
graphicRects[map.getPos(i, j)][1] = "white"
return finalPath, examined
def wasSolved(solved):
if not solved:
print("Map is not solvable")
map = Map()
mapInput = raw_input("Enter map text file: ")
start, goal = map.readMap(mapInput)
win1 = GraphWin("A Star", 500, 500)
(nrOfNodes, pathLen) = searchAlgorithm(map, start.yPos, start.xPos, goal.yPos, goal.xPos, "Astar", win1)
print("Number of nodes for A*: " + str(nrOfNodes))
print("Number of nodes in path for A*: " + str(pathLen))
map2 = Map()
start, goal = map2.readMap(mapInput)
win2 = GraphWin("BFS", 500, 500)
(nrOfNodes, pathLen) = searchAlgorithm(map2, start.yPos, start.xPos, goal.yPos, goal.xPos, "BFS", win2)
print("Number of nodes for BFS: " + str(nrOfNodes))
print("Number of nodes in path for BFS: " + str(pathLen))
map3 = Map()