# Context for a graph with positions
class PositionPathContext
super PathContext
redef type N: PositionedNamedNode
redef type L: PositionedLink
init do
super
for l in graph.links do
var this_cost = cost(l)
if this_cost > worst_cost then worst_cost = this_cost
end
end
redef var worst_cost = 0
redef fun cost(link) do return link.from.dist_with(link.to)
redef fun is_blocked(link) do return false
redef fun heuristic_cost(a, b)
do
var cost = a.dist_with(b)
if cost > 100 then return 100
return cost
end
redef fun worst_heuristic_cost do return 100
end
lib/a_star/tests/test_a_star.nit:271,1--301,3