astar should say if the path returned is ended or not (by calling isPathEnded)