コード例 #1
0
ファイル: adaptation.py プロジェクト: radk0s/pathfinding
def calculateTotalCost(path, elevationFn):
    total_cost= 0
    for i in xrange(len(path) - 1):
        total_cost += costNorm(path[i][0], path[i][1], elevationFn(path[i][0], path[i][1]),
                               path[i + 1][0], path[i + 1][1], elevationFn(path[i + 1][0], path[i + 1][1]))

    return total_cost
コード例 #2
0
ファイル: graph.py プロジェクト: radk0s/pathfinding
def cost(frm, to):
    return costNorm(frm.lon, frm.lat, frm.ele, to.lon, to.lat, to.ele)