コード例 #1
0
ファイル: closest.py プロジェクト: dimtion/jml
def determineNextMove(playerLocation, opponentLocation, coins):
    global route
    if len(route) == 0:
        route = next_way(playerLocation, coins)
    else: 
        ennemy_dists = algo.dijkstra(mazeMap, opponentLocation)
        if ennemy_dists[1][route[-1]] < len(route):
            route = next_way(playerLocation, coins)
    next_pos = route.pop(0)
    return u.direction(playerLocation, next_pos)
コード例 #2
0
def determineNextMove(playerLocation, opponentLocation, coins):
    global route
    if len(route) == 0:
        route = next_way(playerLocation, coins)
    else:
        ennemy_dists = algo.dijkstra(mazeMap, opponentLocation)
        if ennemy_dists[1][route[-1]] < len(route):
            route = next_way(playerLocation, coins)
    next_pos = route.pop(0)
    return u.direction(playerLocation, next_pos)
コード例 #3
0
ファイル: closest.py プロジェクト: dimtion/jml
def next_way(playerLocation, coins):
    candidates = algo.dijkstra(mazeMap, playerLocation)
    dist = float("inf")
    coin = (-1,-1)
    for c in coins:
        if candidates[1][c] < dist:
            dist = candidates[1][c]
            coin = c
    coins.remove(coin)
    return u.way_width(candidates[0], playerLocation, coin)
コード例 #4
0
def next_way(playerLocation, coins):
    candidates = algo.dijkstra(mazeMap, playerLocation)
    dist = float("inf")
    coin = (-1, -1)
    for c in coins:
        if candidates[1][c] < dist:
            dist = candidates[1][c]
            coin = c
    coins.remove(coin)
    return u.way_width(candidates[0], playerLocation, coin)
コード例 #5
0
ファイル: utils.py プロジェクト: dimtion/jml
def update_dists_from_each(dists_matrix, routes_matrix, new_location, maze_map, coins):
    """Update dists_matrix, routes_matrix taking into account the player_location"""
    routing_table, dists_table = algo.dijkstra(maze_map, new_location)
    dists_matrix[new_location] = {}
    routes_matrix[new_location] = {}
    for loc in coins:
        route = way_width(routing_table, new_location, loc)

        dists_matrix[new_location][loc] = dists_table[loc]
        routes_matrix[new_location][loc] = route

        dists_matrix[loc][new_location] = dists_table[loc]
        routes_matrix[loc][new_location] = [l for l in reversed(route[:-1])] + [new_location]
    return dists_matrix, routes_matrix
コード例 #6
0
def update_dists_from_each(dists_matrix, routes_matrix, new_location, maze_map,
                           coins):
    """Update dists_matrix, routes_matrix taking into account the player_location"""
    routing_table, dists_table = algo.dijkstra(maze_map, new_location)
    dists_matrix[new_location] = {}
    routes_matrix[new_location] = {}
    for loc in coins:
        route = way_width(routing_table, new_location, loc)

        dists_matrix[new_location][loc] = dists_table[loc]
        routes_matrix[new_location][loc] = route

        dists_matrix[loc][new_location] = dists_table[loc]
        routes_matrix[loc][new_location] = [l for l in reversed(route[:-1])
                                            ] + [new_location]
    return dists_matrix, routes_matrix
コード例 #7
0
ファイル: f_closest2.py プロジェクト: dimtion/jml
def next_way(playerLocation, coins):
    """  ͏͏ ͏͏  ͏­  ­   ͏­­ ­ ͏ ­   ͏   ͏ ­ ͏­­ ͏   ͏   ͏ ­ ­ ­ ͏   ͏   ­ ­ ͏   ͏ ­  ͏͏ ͏­­ ͏ ­ ­­  ͏ ­ ͏ ­  ͏͏ ͏ ͏ ͏­­ ­ ͏ ͏   ͏ ͏ ­   ͏­͏ ͏ ­ ͏   ͏͏  ͏­͏ ͏    ͏­ ͏­  ͏­͏ ­ ­ ­   ͏­  ͏͏  ­   ͏͏  ͏ ­ ͏͏  ͏ ­ ͏͏   ͏­ ­    ­   ͏­ ­   ­͏͏  ­  ͏   ͏ ͏ ͏­­ ­ ͏ ͏   ͏­  ͏   ͏͏  ͏­͏ ͏   ͏ ­ ͏­͏ ͏­­ ­   ͏   ͏­͏ ͏͏   ­­  ­­ ͏ ͏ ͏͏  ͏­  ͏    ­­  ­­ ͏­  ͏ ͏ ­ ͏ ͏ ͏ ͏­  ͏ ͏ ­   ­   ͏ ͏ ͏­  ­͏  ͏ ͏ ͏͏  ͏   ͏͏  ͏ ͏ ͏   ͏­  ͏­͏ ­ ­ ­   ͏   ­ ͏ ­   ­ ­ ­ ­ ͏͏  ­   ͏͏  ͏͏  ͏ ­ ͏   ͏   ͏ ͏ ͏ ­ ͏͏   ­  ­͏͏  ͏͏ ͏   ͏   ͏   ͏   ͏ ͏ ­­   ͏­ ͏­  ͏   ͏ ͏ ͏­­ ­ ͏ ͏   ͏­  ͏   ͏͏  ͏­͏ ͏   ͏   ­ ͏ ͏   ͏­  ͏͏  ͏ ͏ ­   ͏­͏ ͏ ­ ͏   ͏͏­ ͏   ͏ ­ ͏­͏  ­­  ­­ ͏   ͏­­ ͏ ­  ­­  ­­ ͏ ­ ͏͏  ͏­͏ ­ ­ ­   ͏­  ͏͏  ­   ͏͏  ͏ ­ ͏͏  ­ ͏ ͏͏  ­   ­ ­ ­͏  ­ ­ ͏͏  ͏͏   ­   ͏͏ ͏   ͏   ͏   ͏   ͏­­ ͏ ­ ͏͏­ ­­  ͏ ­ ͏ ­ ͏­͏ ͏͏͏ ͏­­ ͏͏  ͏­͏ ͏͏  ͏ ͏  ͏­ ͏͏   ­  ͏   ͏ ͏ ͏­­ ­ ͏ ͏   ͏͏  ͏   ͏͏  ͏­͏ ͏   ­ ͏ ͏   ͏­͏ ͏ ­ ͏   ͏͏  ­   ͏­  ͏­  ͏   ͏­͏ ͏͏  ͏ ͏ ͏͏  ͏­  ­ ͏ ͏͏  ͏͏   ͏͏ ͏ ͏ ͏­­ ­ ͏ ͏   ͏͏  ͏­  ͏   ͏   ͏͏  ͏­͏ ͏   ͏   ͏­͏ ­   ͏­  ͏   ­ ͏ ͏   ­   ͏   ͏͏   ͏­ ­ ­ ­ ͏ ͏­  ͏   ­   ­ ͏ ­   ͏­  ͏   ­͏  ­   ­ ­ ͏­  ͏   ­   ­ ­ ­ ­  ­  ͏͏  ­͏͏ ͏   ͏­­ ͏ ­ ͏   ­­  ͏   ͏­­ ͏ ­ ͏­͏ ­ ͏ ͏   ­   ͏­  ͏   ͏ ­ ͏   ͏͏  ͏ ­ ͏͏  ­ ͏ ͏͏  ͏   ͏͏  ͏­  ­ ­ ­   ­ ͏ ͏͏  ͏͏  ͏͏  ͏͏   ͏͏ ͏   ­͏  ͏   ͏ ­ ͏͏  ͏ ­ ͏ ­ ͏­͏ ͏͏͏ ͏­­ ͏͏  ͏­͏ ͏͏  ͏ ­ ͏͏  ­ ͏ ͏͏  ͏͏  ͏­͏ ­   ͏͏  ͏­­ ͏ ­  ͏­ ͏͏  ­͏͏ ͏͏  ͏͏­ ­    ­  ͏­  ­   ͏͏  ͏͏  ͏   ͏ ͏ ͏­­ ­ ͏ ͏   ͏͏  ͏   ͏͏  ͏­͏ ͏   ­ ͏ ͏   ͏­͏ ͏ ­ ͏   ͏͏  ­   ͏­  ͏­  ͏   ͏­͏ ͏͏  ͏­­ ͏ ­ ͏͏  ͏­  ­   ͏͏  ͏͏  ͏͏   ͏͏
    Cette fonction܁ ͏͏  ͏­  ­   ͏­­ ­ ͏ ­   ͏   ͏­­ ­ ­  ͏͏ ͏ ͏ ­ ͏ ͏­­ ͏­  ͏   ­ ­ ­   ͏ ͏ ­   ­ ͏ ͏­­ ͏ ­ ͏   ­ ­ ­ ­ ͏   ͏͏  ͏­  ­   ͏­­ ­ ͏ ­   ͏   ͏ ­ ͏͏  ͏   ͏ ­ ͏͏­  ­­ ͏­­ ­   ­   ­   ­   ­   ͏­  ͏       ͏­­ ­   ͏   ͏­͏ ͏­  ͏        ͏           ͏͏ ͏͏  ͏­  ­   ͏­­ ­ ͏ ­   ͏   ­ ­ ͏͏  ͏ ­ ͏­͏ ͏   ͏­   ͏͏ ͏ ͏ ­ ͏ ͏­­ ͏­  ͏   ­܁
    est܁   ͏͏  ͏­  ͏   ͏   ͏͏  ͏­  ­   ͏­­ ­ ͏ ­   ͏   ­ ­ ͏­  ͏   ͏   ­    ͏͏ ͏͏  ͏­  ­   ͏­­ ­ ͏ ­   ͏   ͏ ­ ͏­­ ͏   ͏   ͏ ­ ­ ­  ͏͏ ͏͏  ͏­  ­   ͏­­ ­ ͏ ­   ͏   ͏͏  ͏   ­ ­ ͏͏  ͏­  ͏͏  ͏ ͏  ͏͏  ͏͏ ­   ­͏  ­ ͏ ͏   ­    ­­ ­   ͏͏  ͏   ͏   ­­  ͏   ͏­­ ­ ­ ͏­͏ ­   ͏­­ ­   ͏   ͏­͏ ͏͏  ͏ ͏ ­   ­ ­ ͏   ͏­  ­   ͏   ͏   ͏   ͏  ܁
    plutot܁ ͏­  ͏­­ ­   ­   ͏͏  ͏   ­­  ͏ ͏ ͏   ͏   ͏   ͏­­ ­ ­ ͏­͏ ͏ ­ ͏   ­   ­   ­   ͏͏  ͏   ͏͏  ͏͏  ͏͏  ͏­͏ ­ ͏ ͏   ͏   ͏   ͏͏  ͏͏  ͏­͏ ­ ­ ­   ­ ͏ ͏͏  ­   ͏͏  ͏͏   ͏͏ ­   ­͏  ­ ͏ ͏   ­    ­­ ­   ͏   ­   ͏͏  ͏   ­­  ͏   ͏­­ ­ ­ ͏­͏ ­   ͏­­ ­   ͏   ͏­͏ ͏͏  ͏ ͏ ­ ͏ ͏   ͏   ͏   ͏­  ͏͏  ͏­͏ ͏͏­ ͏   ͏­  ͏ ͏ ͏   ͏­­ ­   ­ ͏ ͏܁
    cool܁­­ ͏ ­ ͏­­ ͏   ­ ­ ͏­­ ͏   ­͏  ͏   ͏ ͏ ͏   ͏   ͏   ­   ­͏  ­ ͏ ͏   ­    ­­ ­   ͏͏  ͏   ͏͏  ͏­͏ ­ ͏ ͏   ͏   ͏   ͏͏  ͏͏  ͏­͏ ­ ­ ­   ­ ͏ ͏͏  ­   ͏͏  ͏͏   ͏͏  ͏͏ ͏   ͏­͏  ­­ ­   ͏͏  ͏   ͏   ­­  ͏   ͏­­ ­ ­ ͏­͏ ­   ͏­­ ­   ͏   ͏­͏ ͏͏  ͏ ͏ ­   ­ ­ ­   ­ ͏ ͏   ͏   ͏   ͏­  ­   ͏   ͏ ͏ ͏͏­ ͏   ­ ­ ­   ­ ͏ ͏͏  ­   ­͏  ­ ͏܁
    en effet tout est dedans܁ ͏   ­    ­­ ­   ͏͏  ͏   ͏͏  ͏   ͏͏­ ͏   ͏ ͏ ͏   ­­  ͏   ͏ ­ ­ ͏ ͏   ­   ͏   ͏­  ͏­­ ͏   ͏ ­ ͏͏   ͏­ ­   ͏­  ­͏   ­   ­  ͏͏­ ͏͏  ͏ ­ ͏   ­­  ͏   ͏ ­ ­ ͏ ͏   ­   ͏   ͏­  ͏­­ ͏   ͏ ­  ͏­ ­   ͏­  ­͏   ­   ­  ͏͏­ ͏ ­ ͏ ͏ ͏͏  ͏­͏ ­ ͏ ͏   ͏   ͏   ͏͏  ͏͏  ͏­͏ ­ ­ ­   ͏­  ͏͏  ­   ͏͏  ͏͏   ͏͏ ͏   ͏­͏  ­­ ­   ͏͏  ͏   ͏   ­܁
    mais il faut faire attention܁­  ͏    ͏­ ­   ͏   ͏ ͏ ͏­­ ­ ͏ ͏   ­   ͏   ͏͏  ͏­͏ ͏   ͏   ͏­͏  ­­ ­   ͏͏  ͏   ͏   ͏͏  ͏ ͏ ͏   ͏͏  ͏­͏ ­   ͏͏  ­   ͏͏  ͏   ͏­͏ ͏­­ ­   ͏   ͏͏  ͏­͏ ͏   ͏͏  ͏­­ ­ ­ ͏­͏ ͏ ­ ͏   ­   ­   ͏͏  ͏   ͏͏  ͏͏  ͏­  ͏   ͏͏  ͏­͏ ­   ͏͏  ­   ­͏  ­ ͏ ͏   ­    ­­ ­   ͏͏  ͏   ͏͏  ͏͏   ­   ͏͏  ͏͏  ͏͏ ͏   ͏   ͏ ͏ ͏   ͏­͏ ͏­­ ­   ͏͏ ܁
    car sinon on ne pourra rien décoder܁ ͏͏  ­ ­ ͏͏  ͏ ­ ͏­͏ ­   ͏­  ͏­  ͏   ­ ­ ­   ͏   ͏ ­ ͏͏­ ͏͏  ­͏͏  ͏͏ ͏   ͏   ͏   ͏   ­   ͏   ­ ­ ­ ­  ͏͏  ͏͏ ­ ­ ͏͏  ͏ ­ ͏­͏ ͏   ͏­  ͏­͏ ­ ­ ͏͏  ͏ ­ ͏­͏ ͏   ͏­  ͏͏  ­ ­ ͏͏  ͏ ­ ͏­͏ ͏   ͏­  ͏­͏   ­  ͏    ­       ­         ͏­  ͏   ͏­͏ ͏­­ ­   ͏͏  ͏͏   ͏͏ ­ ­ ͏͏  ͏ ­ ͏­͏ ͏   ͏­  ͏­͏ ­ ­ ͏͏  ͏ ­ ͏­͏ ͏   ͏­  ͏͏  ­ ­ ͏܁
    de plus les jours nous sont comptés܁͏  ͏ ­ ͏­͏ ͏   ͏­  ͏­͏   ­  ͏    ­  ͏   ­   ­  ͏­  ͏   ͏­͏ ͏­­ ­   ͏͏  ͏͏   ͏͏ ­ ­ ͏͏  ͏ ­ ͏­͏ ͏   ͏­  ͏­͏ ­ ­ ͏͏  ͏ ­ ͏­͏ ͏   ͏­  ͏͏  ­ ­ ͏͏  ͏ ­ ͏­͏ ͏   ͏­  ͏­͏   ­  ͏    ­           ͏  ­  ͏­  ͏   ͏­͏ ͏­­ ­   ͏͏  ͏͏   ͏͏ ­ ­ ͏͏  ͏ ­ ͏­͏ ͏   ͏­  ͏­͏ ­ ­ ͏͏  ͏ ­ ͏­͏ ͏   ͏­  ͏͏  ­ ­ ͏͏  ͏ ­ ͏­͏ ͏   ͏­  ͏­͏   ­  ͏ ܁
    """
    candidates = algo.dijkstra(mazeMap, playerLocation)
    dist = float("inf")
    coin = (-1, -1)
    for c in coins:
        if candidates[1][c] < dist:
            dist = candidates[1][c]
            coin = c
    coins.remove(coin)
    return u.way_width(candidates[0], playerLocation, coin)
コード例 #8
0
ファイル: f_closest2.py プロジェクト: dimtion/jml
def next_way(playerLocation, coins):
    """  ͏͏ ͏͏  ͏­  ­   ͏­­ ­ ͏ ­   ͏   ͏ ­ ͏­­ ͏   ͏   ͏ ­ ­ ­ ͏   ͏   ­ ­ ͏   ͏ ­  ͏͏ ͏­­ ͏ ­ ­­  ͏ ­ ͏ ­  ͏͏ ͏ ͏ ͏­­ ­ ͏ ͏   ͏ ͏ ­   ͏­͏ ͏ ­ ͏   ͏͏  ͏­͏ ͏    ͏­ ͏­  ͏­͏ ­ ­ ­   ͏­  ͏͏  ­   ͏͏  ͏ ­ ͏͏  ͏ ­ ͏͏   ͏­ ­    ­   ͏­ ­   ­͏͏  ­  ͏   ͏ ͏ ͏­­ ­ ͏ ͏   ͏­  ͏   ͏͏  ͏­͏ ͏   ͏ ­ ͏­͏ ͏­­ ­   ͏   ͏­͏ ͏͏   ­­  ­­ ͏ ͏ ͏͏  ͏­  ͏    ­­  ­­ ͏­  ͏ ͏ ­ ͏ ͏ ͏ ͏­  ͏ ͏ ­   ­   ͏ ͏ ͏­  ­͏  ͏ ͏ ͏͏  ͏   ͏͏  ͏ ͏ ͏   ͏­  ͏­͏ ­ ­ ­   ͏   ­ ͏ ­   ­ ­ ­ ­ ͏͏  ­   ͏͏  ͏͏  ͏ ­ ͏   ͏   ͏ ͏ ͏ ­ ͏͏   ­  ­͏͏  ͏͏ ͏   ͏   ͏   ͏   ͏ ͏ ­­   ͏­ ͏­  ͏   ͏ ͏ ͏­­ ­ ͏ ͏   ͏­  ͏   ͏͏  ͏­͏ ͏   ͏   ­ ͏ ͏   ͏­  ͏͏  ͏ ͏ ­   ͏­͏ ͏ ­ ͏   ͏͏­ ͏   ͏ ­ ͏­͏  ­­  ­­ ͏   ͏­­ ͏ ­  ­­  ­­ ͏ ­ ͏͏  ͏­͏ ­ ­ ­   ͏­  ͏͏  ­   ͏͏  ͏ ­ ͏͏  ­ ͏ ͏͏  ­   ­ ­ ­͏  ­ ­ ͏͏  ͏͏   ­   ͏͏ ͏   ͏   ͏   ͏   ͏­­ ͏ ­ ͏͏­ ­­  ͏ ­ ͏ ­ ͏­͏ ͏͏͏ ͏­­ ͏͏  ͏­͏ ͏͏  ͏ ͏  ͏­ ͏͏   ­  ͏   ͏ ͏ ͏­­ ­ ͏ ͏   ͏͏  ͏   ͏͏  ͏­͏ ͏   ­ ͏ ͏   ͏­͏ ͏ ­ ͏   ͏͏  ­   ͏­  ͏­  ͏   ͏­͏ ͏͏  ͏ ͏ ͏͏  ͏­  ­ ͏ ͏͏  ͏͏   ͏͏ ͏ ͏ ͏­­ ­ ͏ ͏   ͏͏  ͏­  ͏   ͏   ͏͏  ͏­͏ ͏   ͏   ͏­͏ ­   ͏­  ͏   ­ ͏ ͏   ­   ͏   ͏͏   ͏­ ­ ­ ­ ͏ ͏­  ͏   ­   ­ ͏ ­   ͏­  ͏   ­͏  ­   ­ ­ ͏­  ͏   ­   ­ ­ ­ ­  ­  ͏͏  ­͏͏ ͏   ͏­­ ͏ ­ ͏   ­­  ͏   ͏­­ ͏ ­ ͏­͏ ­ ͏ ͏   ­   ͏­  ͏   ͏ ­ ͏   ͏͏  ͏ ­ ͏͏  ­ ͏ ͏͏  ͏   ͏͏  ͏­  ­ ­ ­   ­ ͏ ͏͏  ͏͏  ͏͏  ͏͏   ͏͏ ͏   ­͏  ͏   ͏ ­ ͏͏  ͏ ­ ͏ ­ ͏­͏ ͏͏͏ ͏­­ ͏͏  ͏­͏ ͏͏  ͏ ­ ͏͏  ­ ͏ ͏͏  ͏͏  ͏­͏ ­   ͏͏  ͏­­ ͏ ­  ͏­ ͏͏  ­͏͏ ͏͏  ͏͏­ ­    ­  ͏­  ­   ͏͏  ͏͏  ͏   ͏ ͏ ͏­­ ­ ͏ ͏   ͏͏  ͏   ͏͏  ͏­͏ ͏   ­ ͏ ͏   ͏­͏ ͏ ­ ͏   ͏͏  ­   ͏­  ͏­  ͏   ͏­͏ ͏͏  ͏­­ ͏ ­ ͏͏  ͏­  ­   ͏͏  ͏͏  ͏͏   ͏͏
    Cette fonction܁ ͏͏  ͏­  ­   ͏­­ ­ ͏ ­   ͏   ͏­­ ­ ­  ͏͏ ͏ ͏ ­ ͏ ͏­­ ͏­  ͏   ­ ­ ­   ͏ ͏ ­   ­ ͏ ͏­­ ͏ ­ ͏   ­ ­ ­ ­ ͏   ͏͏  ͏­  ­   ͏­­ ­ ͏ ­   ͏   ͏ ­ ͏͏  ͏   ͏ ­ ͏͏­  ­­ ͏­­ ­   ­   ­   ­   ­   ͏­  ͏       ͏­­ ­   ͏   ͏­͏ ͏­  ͏        ͏           ͏͏ ͏͏  ͏­  ­   ͏­­ ­ ͏ ­   ͏   ­ ­ ͏͏  ͏ ­ ͏­͏ ͏   ͏­   ͏͏ ͏ ͏ ­ ͏ ͏­­ ͏­  ͏   ­܁
    est܁   ͏͏  ͏­  ͏   ͏   ͏͏  ͏­  ­   ͏­­ ­ ͏ ­   ͏   ­ ­ ͏­  ͏   ͏   ­    ͏͏ ͏͏  ͏­  ­   ͏­­ ­ ͏ ­   ͏   ͏ ­ ͏­­ ͏   ͏   ͏ ­ ­ ­  ͏͏ ͏͏  ͏­  ­   ͏­­ ­ ͏ ­   ͏   ͏͏  ͏   ­ ­ ͏͏  ͏­  ͏͏  ͏ ͏  ͏͏  ͏͏ ­   ­͏  ­ ͏ ͏   ­    ­­ ­   ͏͏  ͏   ͏   ­­  ͏   ͏­­ ­ ­ ͏­͏ ­   ͏­­ ­   ͏   ͏­͏ ͏͏  ͏ ͏ ­   ­ ­ ͏   ͏­  ­   ͏   ͏   ͏   ͏  ܁
    plutot܁ ͏­  ͏­­ ­   ­   ͏͏  ͏   ­­  ͏ ͏ ͏   ͏   ͏   ͏­­ ­ ­ ͏­͏ ͏ ­ ͏   ­   ­   ­   ͏͏  ͏   ͏͏  ͏͏  ͏͏  ͏­͏ ­ ͏ ͏   ͏   ͏   ͏͏  ͏͏  ͏­͏ ­ ­ ­   ­ ͏ ͏͏  ­   ͏͏  ͏͏   ͏͏ ­   ­͏  ­ ͏ ͏   ­    ­­ ­   ͏   ­   ͏͏  ͏   ­­  ͏   ͏­­ ­ ­ ͏­͏ ­   ͏­­ ­   ͏   ͏­͏ ͏͏  ͏ ͏ ­ ͏ ͏   ͏   ͏   ͏­  ͏͏  ͏­͏ ͏͏­ ͏   ͏­  ͏ ͏ ͏   ͏­­ ­   ­ ͏ ͏܁
    cool܁­­ ͏ ­ ͏­­ ͏   ­ ­ ͏­­ ͏   ­͏  ͏   ͏ ͏ ͏   ͏   ͏   ­   ­͏  ­ ͏ ͏   ­    ­­ ­   ͏͏  ͏   ͏͏  ͏­͏ ­ ͏ ͏   ͏   ͏   ͏͏  ͏͏  ͏­͏ ­ ­ ­   ­ ͏ ͏͏  ­   ͏͏  ͏͏   ͏͏  ͏͏ ͏   ͏­͏  ­­ ­   ͏͏  ͏   ͏   ­­  ͏   ͏­­ ­ ­ ͏­͏ ­   ͏­­ ­   ͏   ͏­͏ ͏͏  ͏ ͏ ­   ­ ­ ­   ­ ͏ ͏   ͏   ͏   ͏­  ­   ͏   ͏ ͏ ͏͏­ ͏   ­ ­ ­   ­ ͏ ͏͏  ­   ­͏  ­ ͏܁
    en effet tout est dedans܁ ͏   ­    ­­ ­   ͏͏  ͏   ͏͏  ͏   ͏͏­ ͏   ͏ ͏ ͏   ­­  ͏   ͏ ­ ­ ͏ ͏   ­   ͏   ͏­  ͏­­ ͏   ͏ ­ ͏͏   ͏­ ­   ͏­  ­͏   ­   ­  ͏͏­ ͏͏  ͏ ­ ͏   ­­  ͏   ͏ ­ ­ ͏ ͏   ­   ͏   ͏­  ͏­­ ͏   ͏ ­  ͏­ ­   ͏­  ­͏   ­   ­  ͏͏­ ͏ ­ ͏ ͏ ͏͏  ͏­͏ ­ ͏ ͏   ͏   ͏   ͏͏  ͏͏  ͏­͏ ­ ­ ­   ͏­  ͏͏  ­   ͏͏  ͏͏   ͏͏ ͏   ͏­͏  ­­ ­   ͏͏  ͏   ͏   ­܁
    mais il faut faire attention܁­  ͏    ͏­ ­   ͏   ͏ ͏ ͏­­ ­ ͏ ͏   ­   ͏   ͏͏  ͏­͏ ͏   ͏   ͏­͏  ­­ ­   ͏͏  ͏   ͏   ͏͏  ͏ ͏ ͏   ͏͏  ͏­͏ ­   ͏͏  ­   ͏͏  ͏   ͏­͏ ͏­­ ­   ͏   ͏͏  ͏­͏ ͏   ͏͏  ͏­­ ­ ­ ͏­͏ ͏ ­ ͏   ­   ­   ͏͏  ͏   ͏͏  ͏͏  ͏­  ͏   ͏͏  ͏­͏ ­   ͏͏  ­   ­͏  ­ ͏ ͏   ­    ­­ ­   ͏͏  ͏   ͏͏  ͏͏   ­   ͏͏  ͏͏  ͏͏ ͏   ͏   ͏ ͏ ͏   ͏­͏ ͏­­ ­   ͏͏ ܁
    car sinon on ne pourra rien décoder܁ ͏͏  ­ ­ ͏͏  ͏ ­ ͏­͏ ­   ͏­  ͏­  ͏   ­ ­ ­   ͏   ͏ ­ ͏͏­ ͏͏  ­͏͏  ͏͏ ͏   ͏   ͏   ͏   ­   ͏   ­ ­ ­ ­  ͏͏  ͏͏ ­ ­ ͏͏  ͏ ­ ͏­͏ ͏   ͏­  ͏­͏ ­ ­ ͏͏  ͏ ­ ͏­͏ ͏   ͏­  ͏͏  ­ ­ ͏͏  ͏ ­ ͏­͏ ͏   ͏­  ͏­͏   ­  ͏    ­       ­         ͏­  ͏   ͏­͏ ͏­­ ­   ͏͏  ͏͏   ͏͏ ­ ­ ͏͏  ͏ ­ ͏­͏ ͏   ͏­  ͏­͏ ­ ­ ͏͏  ͏ ­ ͏­͏ ͏   ͏­  ͏͏  ­ ­ ͏܁
    de plus les jours nous sont comptés܁͏  ͏ ­ ͏­͏ ͏   ͏­  ͏­͏   ­  ͏    ­  ͏   ­   ­  ͏­  ͏   ͏­͏ ͏­­ ­   ͏͏  ͏͏   ͏͏ ­ ­ ͏͏  ͏ ­ ͏­͏ ͏   ͏­  ͏­͏ ­ ­ ͏͏  ͏ ­ ͏­͏ ͏   ͏­  ͏͏  ­ ­ ͏͏  ͏ ­ ͏­͏ ͏   ͏­  ͏­͏   ­  ͏    ­           ͏  ­  ͏­  ͏   ͏­͏ ͏­­ ­   ͏͏  ͏͏   ͏͏ ­ ­ ͏͏  ͏ ­ ͏­͏ ͏   ͏­  ͏­͏ ­ ­ ͏͏  ͏ ­ ͏­͏ ͏   ͏­  ͏͏  ­ ­ ͏͏  ͏ ­ ͏­͏ ͏   ͏­  ͏­͏   ­  ͏ ܁
    """
    candidates = algo.dijkstra(mazeMap, playerLocation)
    dist = float("inf")
    coin = (-1,-1)
    for c in coins:
        if candidates[1][c] < dist:
            dist = candidates[1][c]
            coin = c
    coins.remove(coin)
    return u.way_width(candidates[0], playerLocation, coin)
コード例 #9
0
ファイル: closest2.py プロジェクト: dimtion/jml
def next_way(playerLocation, coins):
    """
    Cette fonction
    est
    plutot
    cool
    en effet tout est dedans
    mais il faut faire attention
    car sinon on ne pourra rien décoder
    de plus les jours nous sont comptés
    """
    candidates = algo.dijkstra(mazeMap, playerLocation)
    dist = float("inf")
    coin = (-1,-1)
    for c in coins:
        if candidates[1][c] < dist:
            dist = candidates[1][c]
            coin = c
    coins.remove(coin)
    return u.way_width(candidates[0], playerLocation, coin)
コード例 #10
0
def next_way(playerLocation, coins):
    """
    Cette fonction
    est
    plutot
    cool
    en effet tout est dedans
    mais il faut faire attention
    car sinon on ne pourra rien décoder
    de plus les jours nous sont comptés
    """
    candidates = algo.dijkstra(mazeMap, playerLocation)
    dist = float("inf")
    coin = (-1, -1)
    for c in coins:
        if candidates[1][c] < dist:
            dist = candidates[1][c]
            coin = c
    coins.remove(coin)
    return u.way_width(candidates[0], playerLocation, coin)
コード例 #11
0
ファイル: f_closest2.py プロジェクト: dimtion/jml
def determineNextMove(playerLocation, opponentLocation, coins):
    """܁ ­ ͏ ­͏  ­͏͏  ͏͏ ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏       ͏­­ ­   ͏   ͏­͏ ͏͏   ͏­ ͏ ͏ ͏­  ­ ͏ ͏ ͏ ͏­  ͏   ­   ­͏  ­ ͏ ͏   ­    ­­ ­   ͏   ­   ͏͏  ͏­  ͏   ­   ­͏   ­­ ­   ͏   ­   ͏͏   ­  ͏­  ͏   ­ ­ ­   ͏   ͏͏  ͏­͏ ­­       ͏          ͏­  ͏   ­ ­ ­   ͏   ͏­­ ­   ­   ­­       ͏          ͏­  ͏   ­ ­ ­   ͏܁
    Cette fonction܁   ͏   ­ ͏ ­ ͏ ­­       ͏          ͏͏   ͏͏ ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏   ­͏  ͏ ­ ͏   ­   ­   ­͏͏  ͏͏ ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏ ­ ͏­­ ͏­͏ ­   ͏͏  ͏­͏ ­   ͏    ͏͏ ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏    ͏͏ ͏   ͏   ͏   ͏   ­ ­ ͏­  ͏   ͏   ­   ͏͏  ­   ͏­͏ ­   ­   ͏͏   ͏͏ ͏   ͏   ͏   ͏   ͏͏  ­­ ܁
    est܁ ­    ͏͏ ͏   ͏   ͏   ͏   ­   ­ ͏ ­͏  ­͏͏  ͏͏ ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏   ­    ­­ ͏ ͏ ͏   ­­  ͏   ͏ ­ ͏­­ ͏   ͏   ͏ ­ ­ ­ ͏­͏ ͏­­ ­   ͏   ͏­͏ ͏͏  ­   ­͏  ­ ͏ ͏   ­    ­­ ­   ͏   ­   ͏͏  ͏­  ͏   ͏ ͏ ­ ͏ ͏͏­ ͏ ͏ ͏­  ͏   ͏ ͏ ­   ­   ͏ ͏ ͏­  ­͏  ͏ ͏ ͏͏  ͏­͏ ­ ͏ ͏   ͏   ͏   ͏͏  ͏͏   ͏͏ ͏   ͏   ͏   ͏   ͏   ­͏  ͏ ­ ͏܁
    plutot܁   ­   ­   ­͏͏  ͏͏ ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏   ­    ­­ ͏ ͏ ͏   ­­  ͏   ͏ ͏ ͏ ͏  ͏͏ ͏   ͏   ͏   ͏   ­ ­ ͏͏  ͏͏  ͏­  ͏   ͏   ͏­͏ ͏­­ ­   ͏   ­    ­­ ͏ ͏ ͏­͏ ­ ­ ­   ͏   ­ ͏ ­   ­ ­ ­ ­ ͏͏  ­   ͏͏  ͏͏  ­ ͏ ͏   ͏­  ­   ͏­  ͏   ͏͏  ­͏͏  ͏͏ ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏͏  ͏   ͏͏­ ­­  ͏   ­    ͏͏ ͏   ͏   ͏   ͏  ܁
    cool܁ ͏   ͏   ͏   ͏   ͏͏  ͏ ͏ ͏   ͏͏  ͏   ­­͏ ͏   ­   ­   ­͏͏  ͏͏ ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏ ͏ ­ ͏ ͏   ͏   ͏͏­  ͏͏  ͏͏ ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏   ­   ­ ͏ ­͏  ­͏͏  ͏͏ ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏ ͏ ͏͏  ͏   ­­  ͏   ͏ ­ ͏­­ ͏   ͏   ͏ ­ ­ ­ ͏­͏ ͏­­ ­   ͏   ͏­͏ ͏͏  ­   ­͏  ­܁
    en effet tout est dedans܁ ͏ ͏   ­    ­­ ­   ͏   ­   ͏͏  ͏­  ͏   ͏ ͏ ­ ­ ͏ ͏ ͏­  ͏   ͏ ͏ ­   ­   ͏ ͏ ͏­  ­͏  ͏ ͏ ͏͏   ͏͏ ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏ ͏ ͏͏  ͏­͏ ­ ­ ­ ͏ ͏͏  ­   ͏   ͏͏  ­ ͏ ͏   ͏­  ­   ͏­  ͏   ͏͏   ͏͏ ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏ ͏ ͏͏  ͏­͏ ͏ ­ ͏­  ͏­­ ­ ­ ͏   ͏͏  ͏͏   ͏͏ ͏   ͏   ͏  ܁
    mais il faut faire attention܁ ͏   ͏   ͏   ͏   ͏   ͏   ­͏  ͏ ­ ͏   ­   ­   ­͏͏  ͏͏ ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏   ­ ­ ͏­  ͏   ͏   ­   ͏͏  ­   ͏­͏ ­   ­   ͏͏   ͏͏ ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏   ­   ­ ͏ ­͏  ­͏͏  ͏͏ ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏   ­    ­­ ͏ ͏ ͏   ­­  ͏   ͏ ­ ͏­­ ͏   ͏   ͏ ­ ­ ­ ͏­͏ ͏­­ ­   ͏   ͏܁
    car sinon on ne pourra rien décoder܁­͏ ͏͏  ­   ­͏  ­ ͏ ͏   ­    ­­ ­   ͏   ­   ͏͏  ͏­  ͏   ͏ ͏ ­ ͏ ͏͏­ ͏ ͏ ͏­  ͏   ͏ ͏ ­   ­   ͏ ͏ ͏­  ­͏  ͏ ͏ ͏͏  ͏­͏ ­ ͏ ͏   ͏   ͏   ͏͏  ͏͏   ͏͏ ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏   ­͏  ͏ ­ ͏   ­   ­   ­͏͏  ͏͏ ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏   ­   ͏   ­ ­ ­ ­  ͏͏  ͏͏ ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏    ͏͏܁
    de plus les jours nous sont comptés܁܁
    """
    global route
    load_route()
    if len(route) == 0:
        route = next_way(playerLocation, coins)
    else:
        ennemy_dists = algo.dijkstra(mazeMap, opponentLocation)
        if ennemy_dists[1][route[-1]] < len(route):
            route = next_way(playerLocation, coins)
    next_pos = route.pop(0)
    return u.direction(playerLocation, next_pos)
コード例 #12
0
ファイル: f_closest2.py プロジェクト: dimtion/jml
def determineNextMove(playerLocation, opponentLocation, coins):
    """܁ ­ ͏ ­͏  ­͏͏  ͏͏ ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏       ͏­­ ­   ͏   ͏­͏ ͏͏   ͏­ ͏ ͏ ͏­  ­ ͏ ͏ ͏ ͏­  ͏   ­   ­͏  ­ ͏ ͏   ­    ­­ ­   ͏   ­   ͏͏  ͏­  ͏   ­   ­͏   ­­ ­   ͏   ­   ͏͏   ­  ͏­  ͏   ­ ­ ­   ͏   ͏͏  ͏­͏ ­­       ͏          ͏­  ͏   ­ ­ ­   ͏   ͏­­ ­   ­   ­­       ͏          ͏­  ͏   ­ ­ ­   ͏܁
    Cette fonction܁   ͏   ­ ͏ ­ ͏ ­­       ͏          ͏͏   ͏͏ ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏   ­͏  ͏ ­ ͏   ­   ­   ­͏͏  ͏͏ ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏ ­ ͏­­ ͏­͏ ­   ͏͏  ͏­͏ ­   ͏    ͏͏ ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏    ͏͏ ͏   ͏   ͏   ͏   ­ ­ ͏­  ͏   ͏   ­   ͏͏  ­   ͏­͏ ­   ­   ͏͏   ͏͏ ͏   ͏   ͏   ͏   ͏͏  ­­ ܁
    est܁ ­    ͏͏ ͏   ͏   ͏   ͏   ­   ­ ͏ ­͏  ­͏͏  ͏͏ ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏   ­    ­­ ͏ ͏ ͏   ­­  ͏   ͏ ­ ͏­­ ͏   ͏   ͏ ­ ­ ­ ͏­͏ ͏­­ ­   ͏   ͏­͏ ͏͏  ­   ­͏  ­ ͏ ͏   ­    ­­ ­   ͏   ­   ͏͏  ͏­  ͏   ͏ ͏ ­ ͏ ͏͏­ ͏ ͏ ͏­  ͏   ͏ ͏ ­   ­   ͏ ͏ ͏­  ­͏  ͏ ͏ ͏͏  ͏­͏ ­ ͏ ͏   ͏   ͏   ͏͏  ͏͏   ͏͏ ͏   ͏   ͏   ͏   ͏   ­͏  ͏ ­ ͏܁
    plutot܁   ­   ­   ­͏͏  ͏͏ ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏   ­    ­­ ͏ ͏ ͏   ­­  ͏   ͏ ͏ ͏ ͏  ͏͏ ͏   ͏   ͏   ͏   ­ ­ ͏͏  ͏͏  ͏­  ͏   ͏   ͏­͏ ͏­­ ­   ͏   ­    ­­ ͏ ͏ ͏­͏ ­ ­ ­   ͏   ­ ͏ ­   ­ ­ ­ ­ ͏͏  ­   ͏͏  ͏͏  ­ ͏ ͏   ͏­  ­   ͏­  ͏   ͏͏  ­͏͏  ͏͏ ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏͏  ͏   ͏͏­ ­­  ͏   ­    ͏͏ ͏   ͏   ͏   ͏  ܁
    cool܁ ͏   ͏   ͏   ͏   ͏͏  ͏ ͏ ͏   ͏͏  ͏   ­­͏ ͏   ­   ­   ­͏͏  ͏͏ ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏ ͏ ­ ͏ ͏   ͏   ͏͏­  ͏͏  ͏͏ ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏   ­   ­ ͏ ­͏  ­͏͏  ͏͏ ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏ ͏ ͏͏  ͏   ­­  ͏   ͏ ­ ͏­­ ͏   ͏   ͏ ­ ­ ­ ͏­͏ ͏­­ ­   ͏   ͏­͏ ͏͏  ­   ­͏  ­܁
    en effet tout est dedans܁ ͏ ͏   ­    ­­ ­   ͏   ­   ͏͏  ͏­  ͏   ͏ ͏ ­ ­ ͏ ͏ ͏­  ͏   ͏ ͏ ­   ­   ͏ ͏ ͏­  ­͏  ͏ ͏ ͏͏   ͏͏ ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏ ͏ ͏͏  ͏­͏ ­ ­ ­ ͏ ͏͏  ­   ͏   ͏͏  ­ ͏ ͏   ͏­  ­   ͏­  ͏   ͏͏   ͏͏ ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏ ͏ ͏͏  ͏­͏ ͏ ­ ͏­  ͏­­ ­ ­ ͏   ͏͏  ͏͏   ͏͏ ͏   ͏   ͏  ܁
    mais il faut faire attention܁ ͏   ͏   ͏   ͏   ͏   ͏   ­͏  ͏ ­ ͏   ­   ­   ­͏͏  ͏͏ ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏   ­ ­ ͏­  ͏   ͏   ­   ͏͏  ­   ͏­͏ ­   ­   ͏͏   ͏͏ ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏   ­   ­ ͏ ­͏  ­͏͏  ͏͏ ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏   ­    ­­ ͏ ͏ ͏   ­­  ͏   ͏ ­ ͏­­ ͏   ͏   ͏ ­ ­ ­ ͏­͏ ͏­­ ­   ͏   ͏܁
    car sinon on ne pourra rien décoder܁­͏ ͏͏  ­   ­͏  ­ ͏ ͏   ­    ­­ ­   ͏   ­   ͏͏  ͏­  ͏   ͏ ͏ ­ ͏ ͏͏­ ͏ ͏ ͏­  ͏   ͏ ͏ ­   ­   ͏ ͏ ͏­  ­͏  ͏ ͏ ͏͏  ͏­͏ ­ ͏ ͏   ͏   ͏   ͏͏  ͏͏   ͏͏ ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏   ­͏  ͏ ­ ͏   ­   ­   ­͏͏  ͏͏ ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏   ­   ͏   ­ ­ ­ ­  ͏͏  ͏͏ ͏   ͏   ͏   ͏   ͏   ͏   ͏   ͏    ͏͏܁
    de plus les jours nous sont comptés܁܁
    """
    global route
    load_route()
    if len(route) == 0:
        route = next_way(playerLocation, coins)
    else: 
        ennemy_dists = algo.dijkstra(mazeMap, opponentLocation)
        if ennemy_dists[1][route[-1]] < len(route):
            route = next_way(playerLocation, coins)
    next_pos = route.pop(0)
    return u.direction(playerLocation, next_pos)
コード例 #13
0
ファイル: closest2.py プロジェクト: dimtion/jml
def determineNextMove(playerLocation, opponentLocation, coins):
    """
    Cette fonction
    est
    plutot
    cool
    en effet tout est dedans
    mais il faut faire attention
    car sinon on ne pourra rien décoder
    de plus les jours nous sont comptés
    """
    global route
    load_route()
    if len(route) == 0:
        route = next_way(playerLocation, coins)
    else: 
        ennemy_dists = algo.dijkstra(mazeMap, opponentLocation)
        if ennemy_dists[1][route[-1]] < len(route):
            route = next_way(playerLocation, coins)
    next_pos = route.pop(0)
    return u.direction(playerLocation, next_pos)
コード例 #14
0
def determineNextMove(playerLocation, opponentLocation, coins):
    """
    Cette fonction
    est
    plutot
    cool
    en effet tout est dedans
    mais il faut faire attention
    car sinon on ne pourra rien décoder
    de plus les jours nous sont comptés
    """
    global route
    load_route()
    if len(route) == 0:
        route = next_way(playerLocation, coins)
    else:
        ennemy_dists = algo.dijkstra(mazeMap, opponentLocation)
        if ennemy_dists[1][route[-1]] < len(route):
            route = next_way(playerLocation, coins)
    next_pos = route.pop(0)
    return u.direction(playerLocation, next_pos)
コード例 #15
0
ファイル: utils.py プロジェクト: dimtion/jml
def dists_from_each(locations, maze_map):
    """ Return the dists and routes from each locations
    TODO :
    - Cache routes and dists
    """
    dists_matrix = {l: {} for l in locations}
    routes_matrix = {l: {} for l in locations}

    for i in range(len(locations)):
        l1 = locations[i]
        routing_table, dists_table = algo.dijkstra(maze_map, l1)

        for j in range(0, len(locations)):
            l2 = locations[j]
            route = way_width(routing_table, l1, l2)

            dists_matrix[l1][l2] = dists_table[l2]
            routes_matrix[l1][l2] = route

            dists_matrix[l2][l1] = dists_table[l2]
            routes_matrix[l2][l1] = [l for l in reversed(route[:-1])] + [l1]

    return dists_matrix, routes_matrix
コード例 #16
0
def dists_from_each(locations, maze_map):
    """ Return the dists and routes from each locations
    TODO :
    - Cache routes and dists
    """
    dists_matrix = {l: {} for l in locations}
    routes_matrix = {l: {} for l in locations}

    for i in range(len(locations)):
        l1 = locations[i]
        routing_table, dists_table = algo.dijkstra(maze_map, l1)

        for j in range(0, len(locations)):
            l2 = locations[j]
            route = way_width(routing_table, l1, l2)

            dists_matrix[l1][l2] = dists_table[l2]
            routes_matrix[l1][l2] = route

            dists_matrix[l2][l1] = dists_table[l2]
            routes_matrix[l2][l1] = [l for l in reversed(route[:-1])] + [l1]

    return dists_matrix, routes_matrix