コード例 #1
0
def generate_unblocked():
    invalid_positions = [(5, y) for y in range(10) if y != 5]
    verticies, edges = gg.generate_grid(0, 10, 0, 10,
                                        gg.make_predicate(invalid_positions))
    starts = [(0, 0)]
    goals = [(10, 10)]
    #gg.plot_grid(verticies, edges)
    return (verticies, edges, starts, goals)
コード例 #2
0
def generate():
    invalid_positions = [(6, y) for y in range(11) if y != 4
                         ] + [(4, y) for y in range(11) if y != 6]
    verticies, edges = gg.generate_grid(0, 10, 0, 10,
                                        gg.make_predicate(invalid_positions))
    starts = [(0, 0), (10, 10)]
    goals = [(10, 10), (0, 0)]
    gg.plot_grid(verticies, edges)
    return (verticies, edges, starts, goals)
コード例 #3
0
def generate_unblocked():
    invalid_positions = [(6, y) for y in range(3, 12) if y != 5 ] + \
                        [(x, 10) for x in range(5)] + \
                        [(x, 4) for x in range(5)] + [(4, 3), (6, 3), (7, 4) , (8, 4), (7, 6) , (8, 6)]
    verticies, edges = gg.generate_grid(0, 15, 0, 11,
                                        gg.make_predicate(invalid_positions))
    starts = [(1, 11)]
    goals = [(14, 1)]
    gg.plot_grid(verticies, edges, start=starts, goal=goals)
    return (verticies, edges, starts, goals)