Sei sulla pagina 1di 22

Planning

Definition
• The task of coming up with a sequence of
actions that will achieve a goal is called
planning.
• Classical planning(Planning with state space
search)
– For environments that are fully observable,
deterministic(predict the consequences of its
actions), finite, static.
• Non-classical planning
– For partially observable or stochastic, dynamic
environments
The Planning languages
• STRIPS (Stanford Research Institute Problem
Solver)
• ADL (Action Description Language)
• PDDL (Planning Domain Definition Language)
Planning Strategies
• One of the simplest planning strategies is to treat
the planning problem as a path planning problem
in the state-space graph.
• In a state-space graph, nodes are states, and arcs
correspond to actions from one state to another.
• The arcs coming out of a state s correspond to all
of the legal actions that can be carried out in that
state.
• A plan is a path from the initial state to a state
that satisfies the achievement goal.
Components of a Plan
• Representation of states
– Literals like At (Plane1; Melbourne), At (Plane2;
Sydney) might represent a state
– Literals such as At (x; y) are not allowed
– Any conditions that are not mentioned in a state
are assumed false.
• Representation of goals
– partially specified state, represented as a
conjunction of positive literals
• Representation of actions.
Representation of Actions
• An action is specified in terms of the
preconditions that must hold before it can be
executed and the effects that happen when it
is executed.
• Example: Action for flying a plane from one
location to another is specified as:
Action(Fly(p,from,to),
PRECOND: At(p,from)  Plane(p)  Airport(from)  Airport(to)
EFFECT: At(p,from)  At(p,to))
Example: Changing Flat Tyre with a
spare problem
• Consider the problem of changing a flat tire
• The initial state has a flat tyre on the axle
• The goal is to have a good spare tyre properly
mounted onto the car’s axle
• Assumption that a good spare tyre is in the
trunk.
Plan for a Spare Tyre Problem
Example: Delivery Robot
Let Rob be an autonomous robot that could be used in
an office environment to deliver mail and/or coffee
Problem States
• The robot's location (rloc), which is one of the
coffee shop (cs), sam's office (off), the mail
room (mr), or the laboratory (lab).
• Whether the robot has coffee (rhc).
• Whether sam wants coffee (swc).
• Whether mail is waiting at the mail room
(mw).
• Whether the robot is carrying the mail (rhm).
Robot Rob’s Actions
• Rob can move clockwise (mc).
• Rob can move counterclockwise (mcc).
• Pick Coffee - puc
• Deliver Coffee - dc
• Pick mail - pum
Scenario 1
• Rob can pick up coffee if Rob is at the coffee
shop.
– Let puc mean that Rob picks up coffee.
– The precondition of puc is ¬rhc∧RLoc=cs;
and it is not already holding coffee.
– The effect of this action is to make RHC
true.
Scenario 2
• Rob can deliver coffee if Rob is carrying coffee
and is at Sam's office.
– Let dc mean that Rob delivers coffee.
– The precondition of dc is rhc ∧RLoc=off.
– The effect of this action is to make RHC false
and make SWC false.
Scenario 3 and 4
• Rob can pick up mail if Rob is at the mail room
and there is mail waiting there.
– Let pum mean Rob picks up the mail.
• Rob can deliver mail if Rob is carrying mail and
at Sam's office.
– Let dm mean Rob delivers mail.
• The precondition ?
• The effect of this action?
Actions and States
The actions can be defined in terms of the state
transitions
STRIPS Representation
• An action consists of the
– Precondition: A set of assignments of values to
features that must be true for the action to occur,
and
– the effect: A set of resulting assignments of values
to those primitive features that change as the
result of the action
Example
• The action of Rob to pick up coffee (puc) has
the following STRIPS representation:
– precondition [cs, ¬rhc]
– effect [rhc]
• That is, the robot must be at the coffee shop
and not have coffee.
• After the action, rhc holds (i.e., RHC=true),
and all other feature values are unaffected by
this action.
Example
• The action of delivering coffee (dc) can be
defined by
– precondition [off, rhc]
– effect [ ¬rhc, ¬swc]
• The robot can deliver coffee when it is in the
office and has coffee.
• It can deliver coffee whether Sam wants coffee or
not.
• If Sam wanted coffee before the action, Sam no
longer wants it after.
• Thus, the effects are to make RHC=false and
SWC=false.
Types of Search Strategies
• Forward Planning (Progression planning ): A
forward planner searches the state-space
graph from the initial state looking for a state
that satisfies a goal description.
• Backward Planning(Regression planning): state
search starting at the goal state(s) and using
the inverse of the actions to search backward
to the initial state.
Forward Planning
Part of the search space starting from the state where Rob is at the coffee shop, Rob does
not have coffee, Sam wants coffee, there is mail waiting, and Rob does not have mail. The
search space is the same irrespective of the goal state.
Regression Planning
Suppose the goal is to achieve ¬swc.
Example: Blocks World Problem
Plan?

Block(A) Block(A)
Block(B) Block(B)
Block(C) Block(C)
Clear(A) Clear(A)
Clear(C) On(A, B)
On(B, Table) On(B, C)
On(C, Table) On( C, Table)
On(A, B) Hand(Empty)
Hand(Empty)

Potrebbero piacerti anche