defining heuristics for planner each planning domain requires its own heuristics if you change the actionsyou will need to reconsider the heuristic functionas there might then be lower-cost pathwhich might make the heuristic non-admissible here is an example of defining (not very goodheuristic for the coffee delivery planning domain first we define the distance between two locationswhich is used for the heuristics stripsheuristic py -planner with heuristic function def dist(loc loc )"""returns the distance from location loc to loc ""if loc ==loc return if {loc ,loc in [{'cs','lab'},{'mr','off'}]return elsereturn note that the current state is complete descriptionthere is value for every feature however the goal need not be completeit does not need to define value for every feature before checking the value for feature in the goala heuristic needs to define whether the feature is defined in the goal stripsheuristic py -(continued def (state,goal)""the distance to the goal locationif there is one""if 'rlocin goalreturn dist(state['rloc']goal['rloc']elsereturn def (state,goal)""the distance to the coffee shop plus getting coffee and delivering it if the robot needs to get coffee ""if ('swcin goal and goal['swc']==false and state['swc']==true and state['rhc']==false)return dist(state['rloc'],'cs')+ elsereturn the maximum of the values of set of admissible heuristics is also an admissible heuristic the function maxh takes number of heuristic functions as argumentsand returns new heuristic function that takes the maximum of the values of the heuristics for exampleh and are heuristic functions and so maxh( , is also maxh can take an arbitrary number of arguments version june