100% found this document useful (1 vote)
3K views26 pages

Planning

Planning in AI refers to the process of computing a sequence of actions to achieve a goal. It involves choosing actions that have a high likelihood of completing a specific task. Planning components include choosing rules to apply based on heuristics, applying rules to get new problem states, and detecting solutions or dead ends. Non-linear planning considers all possible goal orderings, while hierarchical planning generates plans at different levels of abstraction to solve problems more efficiently. Common planning algorithms include goal stack planning, which uses a stack to solve subgoals linearly, and constraint posting for non-linear planning by incrementally adding and ordering operators.

Uploaded by

alvin augustine
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
100% found this document useful (1 vote)
3K views26 pages

Planning

Planning in AI refers to the process of computing a sequence of actions to achieve a goal. It involves choosing actions that have a high likelihood of completing a specific task. Planning components include choosing rules to apply based on heuristics, applying rules to get new problem states, and detecting solutions or dead ends. Non-linear planning considers all possible goal orderings, while hierarchical planning generates plans at different levels of abstraction to solve problems more efficiently. Common planning algorithms include goal stack planning, which uses a stack to solve subgoals linearly, and constraint posting for non-linear planning by incrementally adding and ordering operators.

Uploaded by

alvin augustine
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/ 26

PLANNING

SAROJ SARVESH KUMAR NANDLAL


M. Tech (DTI)
Roll No: 19092036
What is planning in AI?

 The planning in Artificial Intelligence is about the decision making tasks


performed by the robots or computer programs to achieve a specific goal.
 The execution of planning is about choosing a sequence of actions with a
high likelihood to complete the specific task.

Planning refers to the process of computing several steps of a problem


solving before executing any of them. Planning is useful as a problem
solving technique for non decomposable problem.
Components of Planning System:
In any general problem solving systems, elementary techniques to perform
following functions are required:

 Choose the best rule (based on heuristics) to be applied


 Apply the chosen rule to get new problem state
 Detect when a solution has been found
 Detect dead ends so that new directions are explored.

To choose the rules ,


 first isolate a set of differences between the desired goal state and current
state,
 identify those rules that are relevant to reducing these difference,
 if more rules are found then apply heuristic information to choose out of
them.

To apply rules,
In simple problem solving system,
 applying rules was easy as each rule specifies the problem state that would
result from its application.
 In complex problem we deal with rules that specify only a small part of the
complete problem state.
Let us consider the famous problem name as Block World Problem ,which
helps to understand the importance of planning in artificial intelligent system.
The block world environment has ,
 Square blocks of same size
 Blocks can be stacked one upon another.
 Flat surface (table) on which blocks can be placed.
 Robot arm that can manipulate the blocks. It can hold only
one block at a time.

In block world problem, the state is described by a set of predicates


representing the facts that were true in that state .
In addition, some statements that everything else remains unchanged is also
necessary. We are having four types of operations done by robot in block
world environment .They are:

UNSTACK (X, Y) : [US (X, Y)]


 Pick up X from its current position on block Y. The arm must be empty and
X has no block on top of it.
STACK (X, Y): [S (X, Y)]
 Place block X on block Y. Arm must holding X and the top of Y is clear.
PICKUP (X): [PU (X) ]
 Pick up X from the table and hold it. Initially the arm must be empty and
top of X is clear.
PUTDOWN (X): [PD (X)]
 Put block X down on the table. The arm must have been holding block X.

Along with the operations ,some predicates to be used to describe an


environment clearly.

Those predicates are,

 ON(X, Y) - Block X on block Y.


 ONT() - Block X on the table.
 CL(X) - Top of X clear.
 HOLD(X) - Robot-Arm holding X.
 AE - Robot-arm empty.
Initial State:
Armempty
clear(block2)
ontable(block2)
ontable(block1)
clear(block1)

Goal State:

Armempty
ontable(block2)
on(block1, block2)
clear(block1)
We have to generate a plan to reach goal state from initial state given. In this
example the initial state has two blocks Block1 and Block 2.Both is placed on
table. To reach the goal state first we have to
PICKUP(Block 1)
We need to check whether we reach goal
state or not ,after completion of each and
every operation. Here the environment
looks like,
Hold(block1)
Clear(Block2)
OnTable(Block2)
This is not the goal state .so ,we have to continue the process. Next the block
1 needs to be place on block 2,to achieve this do the
operation STACK(Block1,Block2). After this operation the environment
looks like,
ArmEmpty,
on(Block1,Block2),
Clear(Block1),
OnTable(Block2)

We reach the goal state,the plan for


reaching goal state is
PICKUP(Block1) and
Stack(Block1,Block2)
Planning-Goal Stack Algorithm
One of the earliest techniques is planning using goal stack. Problem solver
uses single stack that contains

 sub goals and operators both


 sub goals are solved linearly and then finally the conjoined sub goal is
solved.
Plans generated by this method will contain complete sequence of operations
for solving one goal followed by complete sequence of operations for the next
etc.
Algorithm:

Find an operator that satisfies sub goal G1 (makes it true) and replace
G1 by the operator.

 If more than one operator satisfies the sub goal then apply some
heuristic to choose one.

In order to execute the top most operation, its preconditions are added
onto the stack.
 Once preconditions of an operator are satisfied, then we are
guaranteed that operator can be applied to produce a new state.

 New state is obtained by using ADD and DELETE lists of an operator to the
existing database.

Problem solver keeps track of operators applied.

This process is continued till the goal stack is empty and problem
solver returns the plan of the problem.
Goal Stack Example
With this example, let us explain the working method
of Goal Stack Algorithm.

Initial
State: ON(B,A) ^ ONT(C) ^ ONT(A) ^ ONT(D) ^ CL(B) ^CL(C) ^ CL(D) ^ AE
Goal State: ON(C, A) ^ ON(B, D) ^ ONT(A) ^ ONT(D) ^ CL(C) ^ CL(B) ^ AE
Non-linear planning
This planning is used to set a goal stack and is included in the search space
of all possible subgoal orderings. It handles the goal interactions by
interleaving method.

Advantage of non-Linear planning


Non-linear planning may be an optimal solution with respect to plan length
(depending on search strategy used).

Disadvantages of Nonlinear planning

 It takes larger search space, since all possible goal orderings are taken into
consideration.
 Complex algorithm to understand.
Achieving a goal could possibly undo any of the already
achieved goals and its called as Sussman`s anomaly. In
linear planning, just one goal is taken at a time and
solved completely before the next one is taken.

Let us take an example:


You want to take the car for servicing and have to make an important
phone call. In case of Linear planning, First you will achieve the goal of
making a phone call and then will take the car for servicing. Rather than
completing both the tasks in a linear way, after completion of the task 1, as
partial step, i.e., start the car and put on the Bluetooth, then complete the
task 2 of phone call and then finally, complete the task 1 by leaving the car
at the service station. This can be an example of non-linear planning.
There is a technique called constraint posting that often comes with Non-
Linear Planning.

• The idea of constraint posting is to build up a plan by incrementally,


Adding or Suggesting Operators,Ordering Operators
Binding the variable to the Operators
At any given time in problem solving process, we may have a set of useful
operators but perhaps no clear idea of how those operators should be ordered
with respect to each others.
Let us now examine several operations for nonlinear planning in a constraint
posting environment by incrementally generating a nonlinear plan to solve the
Sussman anomaly problem.
We begin with a null plan. Next we look at the goal state and put
forward steps for achieving that goal. Also we use heuristic in this plan and it
is given below,

Step Addition : Creating new steps for a plan


Promotion : Restrict one step to come before another in a final plan.
DeClobbering : Placing one step s2 between two old steps s1 and s3 such that
s2 makes it possible for s3 to be apply which was previously prevented by s1
Simple Establishment : Assigning a value to a variable.
Separation : Preventing the assignment of certain values to a variable.
Let’s take the initial state as our current state and start the plan creation with
the goal state.

If we observe above we could understand that certain subgoals are already true
and it is highlighted in Red. Therefore we don’t have to consider that part in
our process. So let’s consider the unachieved goals,

These three subgoals, as indicated in the above diagram, are not true in
our current situation so use step addition to achieve these subgoals.
Now check the precondition of all the
actions are satisfied or not. The unsatisfied
preconditions are highlighted in below
diagram.
First Step:

Second Step:

Third Step :

Fourth Step:

Fifth Step :
Sixth Step:

Seventh Step:

The Complete Plan


Hierarchical planning :

-A problem solver may have to generate a long plans to solve hard problems.
-In order to do that efficiently, it is important to be able to eliminate some of
the details of the problem until a solution that addresses the main issues is
found.
-But, in this approach , no details were eliminated from the actual description
of the operators.
-A better approach was developed in the ABSTRIPS system [Sacerdoti,1974],
Which actually planned in a hierarchy of abstraction spaces, in each of which
precondition at a lower level of abstraction were ignored.
The ABSTRIPS approach to problem solving is as follows :
 First Solve the problem completely , considering only preconditions whose
criticality value is the highest possible .These value reflect the expected
difficulty of satisfying the precondition .
 To do this ,do exactly what STRIPS did,but simply ignore preconditions of
lower than peak criticality .Once this is done ,Use the constructed plan as the
outline of a complete plan and consider the preconditions at the next lowest
criticality level.
 Clearly, the assignment of appropriate criticality values is crucial to the
success of this hierarchical planning method.
Those preconditions that no operators can satisfy are clearly the most critical.
REACTIVE SYSTEMS:
A reactive system must have access to a knowledge base of some sort that
describes what actions should be taken under what circumstances .
A reactive system is very different from other kinds of planning systems we
have discussed because it chooses actions one at a time.It does not anticipate
and select an entire action sequence before it does the first thing.
For eg.
One of the very simplest reactive systems is a thermostat. The job of
thermostat is to keep the temperature constant inside the room .one might
imagine a solution to this problem that requires significant amounts of planning
, taking into account how the external tempratures rises and falls during the
day,how heat flows from room to room ,and so forth. Reactive systems are
capable of surprisingly complex behaviours, especially in real world tasks such
as robot navigation.

You might also like