Question: def heuristic _ exp ( self , neighbor, map _ , v ) : cheby = max ( abs ( neighbor . x - v

def heuristic_exp(self, neighbor, map_, v):
cheby = max(abs(neighbor.x - v.x), abs(neighbor.y - v.y))
height_difference = max(abs(neighbor.x - map_.goal.x), abs(neighbor.y - map_.goal.y))
if height_difference ==0:
altitude_weight = cheby
elif height_difference <10:
altitude_weight =10* math.exp(0.1* height_difference)
else:
altitude_weight =10* math.exp(0.1* height_difference)
heuristic = altitude_weight * cheby
return heuristic

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!