Question 1: Heuristics in STRIPS: a video game example
(a)
Loc_i = {T/F} for i = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}, and Boolean variables Loc3 free, Loc9 free,
Weapon charged, Charge1Available, Charge4Available
(b)
- move right4: preconditions {Loc4=T }, effects: { Loc4=F, Loc5=T}
- move left4: preconditions {Loc4=T, loc3 free = T }, effects: { Loc4=F, Loc3= T}
- pickup4: preconditions {Loc4 = T, charge4 available=T}, effects: {weapon charged =T, charge4
available = F}
- fire4: preconditions {Loc4 = T ,weapon charged = T}, effects: {loc3 free = T; weapon charged =
F}
(c)
Optimal path: fire, right, right. Figure 1 shows the corresponding search graph.
(d)
The following are some possible answers:
• The agent’s distance to the goal
• Add to the above the number of monsters standing in between the agent and the goal (location 10).
• Add to the above the minimal number of extra steps required to recharge the weapon for each monster
between the agent’s position and the goal location.
1
, (e,f,g)
State in e: (¬Loc_1, ¬Loc_2, ¬Loc_3, ¬Loc_4, ¬Loc_5, ¬Loc_6, ¬Loc_7, ¬Loc_8, Loc_9, ¬Loc_10,
Loc3 free, Loc9 free, Weapon charged, Charge1Available, Charge4Available)
State in f: (¬Loc_1, ¬Loc_2, ¬Loc_3, ¬Loc_4, ¬Loc_5, ¬Loc_6, ¬Loc_7, Loc_8, ¬Loc_9, ¬Loc_10,
¬Loc3 free, ¬Loc9 free, Weapon charged, Charge1Available, Charge4Available)
This heuristic is 1 everywhere except in goal states: if the precondition of move right9 is empty, we can
apply this regardless of the state we’re in, and it will make the location 10. This does not help us
distinguish good states from bad states.
(h,i,j)
Relaxed plan for n=(8, ¬3 free, ¬9 free, charged, c1, c4): fire8, move right8, move right9.
h(n) = 3.
Relaxed plan for n’=(9, 3 free, 9 free, charged, c1, c4): move right 9. h(n) = 1.
The heuristic is more useful since it provides more guidance towards useful states
2
(a)
Loc_i = {T/F} for i = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}, and Boolean variables Loc3 free, Loc9 free,
Weapon charged, Charge1Available, Charge4Available
(b)
- move right4: preconditions {Loc4=T }, effects: { Loc4=F, Loc5=T}
- move left4: preconditions {Loc4=T, loc3 free = T }, effects: { Loc4=F, Loc3= T}
- pickup4: preconditions {Loc4 = T, charge4 available=T}, effects: {weapon charged =T, charge4
available = F}
- fire4: preconditions {Loc4 = T ,weapon charged = T}, effects: {loc3 free = T; weapon charged =
F}
(c)
Optimal path: fire, right, right. Figure 1 shows the corresponding search graph.
(d)
The following are some possible answers:
• The agent’s distance to the goal
• Add to the above the number of monsters standing in between the agent and the goal (location 10).
• Add to the above the minimal number of extra steps required to recharge the weapon for each monster
between the agent’s position and the goal location.
1
, (e,f,g)
State in e: (¬Loc_1, ¬Loc_2, ¬Loc_3, ¬Loc_4, ¬Loc_5, ¬Loc_6, ¬Loc_7, ¬Loc_8, Loc_9, ¬Loc_10,
Loc3 free, Loc9 free, Weapon charged, Charge1Available, Charge4Available)
State in f: (¬Loc_1, ¬Loc_2, ¬Loc_3, ¬Loc_4, ¬Loc_5, ¬Loc_6, ¬Loc_7, Loc_8, ¬Loc_9, ¬Loc_10,
¬Loc3 free, ¬Loc9 free, Weapon charged, Charge1Available, Charge4Available)
This heuristic is 1 everywhere except in goal states: if the precondition of move right9 is empty, we can
apply this regardless of the state we’re in, and it will make the location 10. This does not help us
distinguish good states from bad states.
(h,i,j)
Relaxed plan for n=(8, ¬3 free, ¬9 free, charged, c1, c4): fire8, move right8, move right9.
h(n) = 3.
Relaxed plan for n’=(9, 3 free, 9 free, charged, c1, c4): move right 9. h(n) = 1.
The heuristic is more useful since it provides more guidance towards useful states
2