UNIT III PLANNING Planningwithstate-space search –partial-orderplanning–planninggraphs –
planningandactinginthe real world
Define planning?
 The task of coming up with a sequence of actions that will achieve a goal is
called planning.
 Planning can be viewed as a type of problem solving in which the agent uses
beliefs about actions and their consequences to search for a solution.
 Construction of plans, and executing those plans in order to achieve its goal is
known as planning.
STRIPS
Basic representation of language and expansion of classical planner is Standard
Research Institute for Problem Solving.
Comparison of STRIPS and ADL languages for representing planning problems
Code for simple planning agent:
function simple_planning_Agent(percept) returns an action
static :KB, a knowledge base ( includes action descriptors)
p, a plan, initially no plan
t, a counter, initially 0, indicating time
local variables : G , a goal current, a current state descriptors
TELL (KB, MAKE_PERCEPT_SEQUENCE(Percept, t))
Current  state_ descriptors(KB, t)
if p=No plan then
G  ASK (KB, make_Goal_query(t))
PIdeal_Planner(current,G,KB)
if p= No plan or p is empty then action  No op
else
Action First(P)
PREST(p)
TELL(KB, make_action_sentence(action, t))
t t+1
return action
A STRIPS problem involving transportation of air cargo between airports(Air cargo
transport)
A STRIPS problem involving transportation of air cargo between airports.
Figure shows an air cargo transport problem involving loading and unloading cargo onto and
off of planes and flying it from place to place. The problem can be defined with three actions:
Load, Unload, and Fly. The actions affect two predicates: In(c, p) means that cargo c is inside
plane p, and A t ( x , a) means that object x (either plane or cargo) is at airport a. Note that
cargo is not At anywhere when it is In a plane, so At really means "available for use at a given
location." It takes some experience with action definitions to handle such details consistently.
The following plan is a solution to the problem:
[Load( C1,P I ,S FO), Fly (PI ,S FO, J FK), Unload (Cl, P I , J FK),
Load(Cz, P2, JFK), Fly(P2, JFK, SFO), Unload (Cz, P2, SFO)] .
Our representation is pure STRIPS. In particular, it allows a plane to fly to and from the same airport.
Inequality literals in ADL could prevent this.
The spare tire problem
Consider the problem of changing a flat tire. More precisely, the goal is to have a
good spare tire properly mounted onto the car's axle, where the initial state has a flat tire on
the axle and a good spare tire in the trunk. To keep it simple, our version of the problem is a
very abstract one, with no sticky lug nuts or other complications. There are just four actions:
removing the spare from the trunk, removing the flat tire from the axle, putting the spare on
the axle, and leaving the car unattended overnight. We assume that the car is in a particularly
bad neighbourhood, so that the: effect of leaving it overnight is that the tires disappear.
The simple spare tire problem.
Ai unit3 planing

Ai unit3 planing

  • 1.
    UNIT III PLANNINGPlanningwithstate-space search –partial-orderplanning–planninggraphs – planningandactinginthe real world Define planning?  The task of coming up with a sequence of actions that will achieve a goal is called planning.  Planning can be viewed as a type of problem solving in which the agent uses beliefs about actions and their consequences to search for a solution.  Construction of plans, and executing those plans in order to achieve its goal is known as planning. STRIPS Basic representation of language and expansion of classical planner is Standard Research Institute for Problem Solving. Comparison of STRIPS and ADL languages for representing planning problems Code for simple planning agent:
  • 2.
    function simple_planning_Agent(percept) returnsan action static :KB, a knowledge base ( includes action descriptors) p, a plan, initially no plan t, a counter, initially 0, indicating time local variables : G , a goal current, a current state descriptors TELL (KB, MAKE_PERCEPT_SEQUENCE(Percept, t)) Current  state_ descriptors(KB, t) if p=No plan then G  ASK (KB, make_Goal_query(t)) PIdeal_Planner(current,G,KB) if p= No plan or p is empty then action  No op else Action First(P) PREST(p) TELL(KB, make_action_sentence(action, t)) t t+1 return action A STRIPS problem involving transportation of air cargo between airports(Air cargo transport) A STRIPS problem involving transportation of air cargo between airports. Figure shows an air cargo transport problem involving loading and unloading cargo onto and off of planes and flying it from place to place. The problem can be defined with three actions:
  • 3.
    Load, Unload, andFly. The actions affect two predicates: In(c, p) means that cargo c is inside plane p, and A t ( x , a) means that object x (either plane or cargo) is at airport a. Note that cargo is not At anywhere when it is In a plane, so At really means "available for use at a given location." It takes some experience with action definitions to handle such details consistently. The following plan is a solution to the problem: [Load( C1,P I ,S FO), Fly (PI ,S FO, J FK), Unload (Cl, P I , J FK), Load(Cz, P2, JFK), Fly(P2, JFK, SFO), Unload (Cz, P2, SFO)] . Our representation is pure STRIPS. In particular, it allows a plane to fly to and from the same airport. Inequality literals in ADL could prevent this. The spare tire problem Consider the problem of changing a flat tire. More precisely, the goal is to have a good spare tire properly mounted onto the car's axle, where the initial state has a flat tire on the axle and a good spare tire in the trunk. To keep it simple, our version of the problem is a very abstract one, with no sticky lug nuts or other complications. There are just four actions: removing the spare from the trunk, removing the flat tire from the axle, putting the spare on the axle, and leaving the car unattended overnight. We assume that the car is in a particularly bad neighbourhood, so that the: effect of leaving it overnight is that the tires disappear. The simple spare tire problem.