有人可以建议以下哪种距离公式用于角落启发式问题?
heuristic = 0 currentState, visitedCorners = state copyOfVisitedCorners = list(visitedCorners) for i in range(4): cornerDistance = [0, 0, 0, 0] cornerCounter = 0 for corner in copyOfVisitedCorners: cornerDistance[cornerCounter] = euclidean(currentState,corners[cornerCounter]) cornerCounter += 1 cornerCounter1 = 0 closestCorner = 0 for currentValue in cornerDistance: if (copyOfVisitedCorners[closestCorner]): closestCorner = cornerCounter1 if (not copyOfVisitedCorners[cornerCounter1]) and (currentValue < cornerDistance[closestCorner]): closestCorner = cornerCounter1 cornerCounter1 += 1 if (not copyOfVisitedCorners[closestCorner]): heuristic += cornerDistance[closestCorner] currentState = corners[closestCorner] copyOfVisitedCorners[closestCorner] = True return heuristic