Allow A* edge cost calculation to be overidden.