0% found this document useful (0 votes)
6 views33 pages

Chapter 5 Planning

The document discusses planning in Artificial Intelligence, detailing how agents perceive their environment and perform actions to achieve goals. It distinguishes between classical and non-classical planning, explores various planning techniques such as forward and backward state space search, and introduces concepts like total order and partial order planning. Additionally, it covers hierarchical and conditional planning, providing examples and representations of planning problems using STRIPS and ADL.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views33 pages

Chapter 5 Planning

The document discusses planning in Artificial Intelligence, detailing how agents perceive their environment and perform actions to achieve goals. It distinguishes between classical and non-classical planning, explores various planning techniques such as forward and backward state space search, and introduces concepts like total order and partial order planning. Additionally, it covers hierarchical and conditional planning, providing examples and representations of planning problems using STRIPS and ADL.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 33

Module 5

Planning & Learning

CE– TE– Artificial Intelligence


Dr. Kalyani Pampattiwar
Associate professor
Dept. of Computer Engineering
SIES Graduate School of Technology

Dr.
Dr.Kalyani
KalyaniPampattiwar
Pampattiwar
Dr.
Dr.Kalyani
KalyaniPampattiwar
Pampattiwar
Planning
• In Artificial Intelligence, there are agents which perceive the environment via
sensors and act upon the environment through actuators or effectors.
• Just like humans have sensors through which we sense our surroundings (eyes,
ears, nose, tongue, and skin) and actuators (limbs) to perform actions on these
surroundings.
• The agent starts from the initial state and performs a series of actions in order to
reach the goal state.
• For instance, a vacuum cleaner agent will perform actions of moving right and
left, and sucking in dirt to reach the goal of successfully cleaning the environment.

Dr. Kalyani Pampattiwar


Planning Example

Dr. Kalyani Pampattiwar


Problem Solving
Initial to goal state

• Representation of actions
- actions generate successor states
• Representation of states
- A state is a complete description of the system at a given point in
time.
• Representation of goals
- contained in goal test and heuristic function
• Representation of plans
- unbroken sequence of actions leading from initial to goal state
Dr. Kalyani Pampattiwar
Planning vs. Problem Solving

Dr. Kalyani Pampattiwar


Dr. Kalyani Pampattiwar
Planning and its types
• This activity of coming up with a sequence of actions in order to accomplish
the target or goal is called as Planning.

• Planning can be Classical or Non-classical.

• In case of Classical Planning, the environment is fully observable,


deterministic, static and discrete

• In case of Non-classical Planning, the environment is partially observable


(i.e. the entire state of the environment is not visible at a given instant) or
non- deterministic (or stochastic, i.e. the current state and chosen action
cannot completely determine the next state of the environment).
Dr. Kalyani Pampattiwar
Planning languages
Representation of Planning problems is often done using STRIPS (Stanford
Research Institute Problem Solver).
It consists of:
• A set of states- It is a conjunction of positive ground literals.
• A set of goals- partially specified state represented as a conjunction of
positive literals
• A set of actions- For each action, there is a precondition that must be
satisfied and an effect which reflects the impact the action has on the
environment after it has been performed.
• Planning problems can also be represented using ADL (Action Description
Language)

Dr. Kalyani Pampattiwar


Dr. Kalyani Pampattiwar
Planning using State Space Search
• State space consists of the initial state, set of goal states, set of actions
or operations, set of states and the path cost.

• This state space needs to be searched to find a sequence of actions


leading to the goal state.

• This can be done in the forward or backward direction.

Dr. Kalyani Pampattiwar


Forward State Space Search(FSSS)
• It is also called Progression. It starts from the initial state and searches in
the forward direction till we reach the goal. It uses STRIPS representation.
This is how the problem formulation looks like.
• Initial state: start state
• Actions: Each action has a particular precondition to be satisfied before the
action can be performed and an effect that the action will have on the
environment.
• Goal test: To check if the current state is the goal state or not.
• Step cost: Cost of each step which is assumed to be 1.
• FSSS starts from the initial state and applies actions to reach the next state.
It then checks whether this state is the goal state or not. If not, it continues
to apply other actions till the goal is reached.
Dr. Kalyani Pampattiwar
• The problem involves
transporting cargo using
airplanes between airports.
• Let’s take an example of
the Air cargo problem.
Here P1 and P2 are the two
planes and A and B are the
two airports. C1 and C2 are
cargos. We start from the
initial state and use the
problem’s actions to search
forward for the goal state.

Dr. Kalyani Pampattiwar


Backward State Space Search
• It is also called as Regression.
• It uses STRIPS representation.
• The problem formulation is similar to that of FSSS and consists of the
initial state, actions, goal test and step cost.
• In BSSS, the searching starts from the goal state, and moves in the
backward direction until the initial state is reached.
• It starts at the goal, checks if it is the initial state.
• If not, it applies the inverse of the actions to produce sub goals until
start state is reached.

Dr. Kalyani Pampattiwar


• The problem involves
transporting cargo using
airplanes between airports.
• Let’s take an example of
the Air cargo problem.
Here P1 and P2 are the two
planes and A and B are the
two airports. C1 and C2 are
cargos. We start from the
initial state and use the
problem’s actions to search
forward for the goal state.

Dr. Kalyani Pampattiwar


1. Define the Goal State
We need:
• C1 at JFK
• C2 at SFO
Thus, the goal state is:

Dr. Kalyani Pampattiwar


Dr. Kalyani Pampattiwar
Dr. Kalyani Pampattiwar
Total Order planning (TOP)
• FSSS and BSSS are examples of TOP.
• They only explore linear sequences of actions from start to goal state,
They cannot take advantage of problem decomposition, i.e. splitting
the problem into smaller sub-problems and solving them individually.

Dr. Kalyani Pampattiwar


Partial Order Planning (POP)

• It works on problem decomposition.


• It will divide the problem into parts and achieve these sub goals
independently.
• It solves the sub problems with sub plans and then combines these sub
plans and reorders them based on requirements.
• In POP, ordering of the actions is partial. It does not specify which
action will come first out of the two actions which are placed in the
plan.
• The problem of wearing shoes can be performed through total order or
partial order planning.

Dr. Kalyani Pampattiwar


• Init: Barefoot
• Goal: RightShoeOn ^ LeftShoeOn
Action: 1. RightShoeOn
Precondition: RightSockOn
Effect: RightShoeOn
Action 2. LeftShoeOn
Precondition: LeftSockOn
Effect: LeftShoeOn
Action 3. LeftSockOn
Precondition: Barefoot
Effect: LeftSockOn
Action 4. RightSockOn
Precondition: Barefoot
Effect: RightSockOn
Dr. Kalyani Pampattiwar
Dr. Kalyani Pampattiwar
• The TOP consists of six sequences, one of which can be taken in order
to reach the finish state.
• However, the POP is less complex. It combines two action sequences.
• The first branch covers the left sock and left shoe.
• To wear left shoe, wearing the left sock is a precondition.
• Similarly, the second branch covers the right sock and right shoe.
• Once these actions are taken, we achieve our goal and reach the finish
state.

Dr. Kalyani Pampattiwar


Defining a Partial Order Plan
• A set of actions, that make up the steps of the plan. For instance,
{RightShoe, RightSock, LeftShoe, LeftSock, Start, Finish}.
• A set of ordering constraints, A before B. For instance, {RightSock <
RightShoe, LeftSock < LeftShoe}.

• A set of causal links, A achieves P for B.

• A set of open preconditions. A precondition is open if it is not


achieved by some action in the plan.

Dr. Kalyani Pampattiwar


Hierarchical Planning
• Here the plans are organized in a hierarchical format. It works on plan decomposition.
Complex actions are decomposed into simpler or primitive ones, and it can be denoted with
the help of links between various states at different levels of the hierarchy. This is called
operator expansion.
• Primitive tasks- these correspond to the actions of STRIPS,
• Compound tasks- these are a set of simpler tasks,
• Goal tasks- these correspond to goals of STRIPS.
• In Hierarchical Planning, we find a sequence of primitive tasks by decomposition of
compound tasks, in order to reach the goal. For example, in case of building a house,
hierarchical planning is used as shown below.

Dr. Kalyani Pampattiwar


Conditional Planning
• It works regardless of the outcome of an action.
• It deals with uncertainty by inspecting what is happening in the
environment at predetermined points in the plan.
• It can take place in fully observable and non-deterministic environments.
• It will take actions and must be able to handle every outcome for the
action taken.
• For instance, If <test-cond> then plan A else plan B.
• In case of a vacuum cleaner problem, If At Left ^ Clean then Right else
Suck.

Dr. Kalyani Pampattiwar


Block World Problem

Dr. Kalyani Pampattiwar


Dr. Kalyani Pampattiwar
Dr. Kalyani Pampattiwar
• Designing the Agent
• Idea is to give an agent:
• Representation of goal/intention to achieve
• Representation of actions it can perform; and
• Representation of the environment;
- Then have the agent generate a plan to achieve the goal.
- The plan is generated entirely by the planning system, without human intervention.
- Assume start & goal states as below:
STRIPS : A planning system – Has rules with precondition deletion list and addition list
• Sequence of actions :
a. Grab C
b. Pickup C
c. Place on table C
d. Grab B
e. Pickup B
f. Stack B on C
g. Grab A
h. Pickup A Dr. Kalyani Pampattiwar
Rules:
• R1 : pickup(x)
1. Precondition & Deletion List :
hand empty, on(x,table), clear(x)
2. Add List : holding(x)

• R2 : putdown(x)
Plan for the assumed blocks world problem
1. Precondition & Deletion List : holding(x) For the given problem, Start → Goal can be achieved
2. Add List : hand empty, on(x,table), clear(x) by the following sequence:
1.Unstack(C,A)
• R3 : stack(x,y) 2.Putdown(C)
1. Precondition & Deletion List :holding(x), clear(y) 3.Pickup(B)
2. Add List : on(x,y), clear(x) 4.Stack(B,C)
5.Pickup(A)
6.Stack(A,B)
• R4 : unstack(x,y)
1. Precondition & Deletion List : on(x,y), clear(x)
2. Add List : holding(x), clear(y)
Dr. Kalyani Pampattiwar
Spare Tire Problem

• Consider problem of changing flat tire. There are just 4 actions:


removing spare from trunk, removing flat tire from axle, putting spare
tire on axle, and leaving car unattended overnight.
• ADL description is as shown. It uses negated precondition, negation.
This could be avoided by using Clear (Axle) instead.

• Init(At(Flat,Axle) ˄ At(Spare,Trunk))
• Goal(At(Spare,Axle))

Dr. Kalyani Pampattiwar


• Solution using ADL:
• Init(At(Flat,Axle) ˄ At(Spare,Trunk))
• Goal(At(Spare,Axle))
• Action(remove(Spare,Trunk),
• PRECOND: At(Spare,Trunk)
• EFFECT :¬ At(Spare,trunk)˄At(Spare, Ground)
• Action(Remove(Flat,Axle),
• PRECOND:At(Flat,Axle)
• EFFECT : ¬ At(Flat,Axle)˄At(Flat, Ground)
• Action(PutOn(Spare,Axle),
• PRECOND ; At(Spare,Ground)˄ ¬ At(Flat,Axle)
• EFFECT: ¬ At(Spare,Ground) ˄ At(Spare,Axle))
• Action(LeaveOvernight)
• PRECOND
• EFFECT : ¬ At(Spare,Ground)˄ ¬ At(Spare, Axle)˄ ¬ At(Spare,trunk)˄ ¬ At(Flat,Ground)˄ ¬ At(Flat,Axle))
Dr. Kalyani Pampattiwar

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy