Property definitions

a_star $ WeightedPathContext :: defaultinit
# A `PathContext` for graphs with `WeightedLink`
class WeightedPathContext
	super PathContext
	serialize

	redef type L: WeightedLink

	init
	do
		super

		var worst_cost = 0
		for l in graph.links do
			var cost = l.weight
			if cost >= worst_cost then worst_cost = cost + 1
		end
		self.worst_cost = worst_cost
	end

	redef var worst_cost is noinit

	redef fun cost(l) do
		return l.weight
	end
	redef fun is_blocked(l) do return false
	redef fun heuristic_cost(a, b) do return 0
	redef fun worst_heuristic_cost do return 0
end
lib/a_star/a_star.nit:376,1--403,3