本文整理汇总了Python中Grid.Grid.setGoal方法的典型用法代码示例。如果您正苦于以下问题:Python Grid.setGoal方法的具体用法?Python Grid.setGoal怎么用?Python Grid.setGoal使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Grid.Grid
的用法示例。
在下文中一共展示了Grid.setGoal方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Grid
# 需要导入模块: from Grid import Grid [as 别名]
# 或者: from Grid.Grid import setGoal [as 别名]
grid6 = Grid(6, 0, True)
grid7 = Grid(7, -1)
grid8 = Grid(8, 0, True)
grid9 = Grid(9, -1)
grid10 = Grid(10, -1)
grid11 = Grid(11, -1)
grid12 = Grid(12, -1)
grid13 = Grid(13, -1)
grid14 = Grid(14, -50)
grid15 = Grid(15, -1)
grid16 = Grid(16, -1)
grid17 = Grid(17, -1)
grid18 = Grid(18, -1)
grid19 = Grid(19, -1)
grid20 = Grid(20, 10)
grid20.setGoal()
gWorld = GridWorld([[grid1,grid2,grid3,grid4],[grid5,grid6,grid7,grid8],[grid9,grid10,grid11,grid12],[grid13,grid14,grid15,grid16],[grid17,grid18,grid19,grid20]])
gWorld.setMovement({"left":{"left":1}, "right":{"right":0.8, "down":0.2}, "up":{"up":0.8, "left":0.2}, "down":{"down":1}})
# for i in range(0, 5):
# for j in range(0, 4):
# grid = gWorld.getGrids()[i][j]
# if not grid.isBlocked():
# print str(grid.getGridName()) + " :: ",
# for x in gWorld.getMovesPossible(grid):
# print str(x.getGridName()) + " ,",
# print ""
#
gWorld.getAllGridsReachableFromCurGrid(grid17)
gWorld.printGridWorldValueMatrix()