Artificial Intelligence: Planning Agents
Artificial Intelligence: Planning Agents
PLANNING AGENTS
Professor Janis Grundspenkis
E-mail: [email protected]
Simple Planning Agents (1)
Representation of goals
Agent has information in the form of goal test
and the heuristic function
Representation of solutions (plans)
A solution is sequence of actions beginning
from the initial state, and ending at a goal
state
Basic Elements
of Planning Agent
Planning algorithms use descriptions in some
formal language, usually first-order logic
Representation of actions
Logical descriptions of preconditions and effects
Representation of states
Set of sentences of first-order logic
Representation of goals
Set of sentences of first-order logic
Representation of plans
Direct connections between states and actions
Three Key Ideas Behind
Planning
1. Open up the representation of states, goals
and actions
2. The planner is free to add actions to the plan
wherever they are needed (instead of growing
sequence of actions starting at the initial state)
3. Most parts of the world are independent from
the other parts
Divide-and-conquer strategy is used,
because it is easier to solve several small
sub-problems rather than one big problem
Representations for Planning
Representations for states and
goals
Representations for actions
Situation Space
Plan Space
Representations for Plans
Solutions
Representations
for States and Goals (1)
STRIPS language is used in most
planners
In STRIPS language states are
represented by conjunctions of
predicates (possibly negated) with
constants as their terms
Example:
At(Shop) Have(Money) Have(Computer)
Representations
for States and Goals (2)
In STRIPS language goals or represented by
conjunctions of predicates with constants and
variables used as their terms
Examples:
At(home) Have(Computer)
At(x) Sells(x, Computer)
> Variables are assumed to be existentially
quantified
Representations of initial states and goals are
used as inputs of planning systems
Representations
for Actions (1)
STRIPS operators consist from
three components:
The action description
Within the planner it is only the name
of a possible action
Agent returns it to the environment in
order to do something
Representations
for Actions (2)
The precondition
It is a conjunction of predicates (not
negated) that must be true before the
operator can be applied
The effect of an operator
It is a conjunction of predicates
(possibly negated) that describes how
the situation changes when the
operator is applied
STRIPS Operator (1)
Syntax:
Operator (ACTION: actions name,
PRECONDITION: p(x) q(y) ...
EFFECT: r(y) w(x) ...)
where p and q denotes any predicates; p and w
may be changed to r and/or w in EFFECT
> An operator with variables is called operator
schema
> All variables are assumed universally
quantified
STRIPS Operator (2)
At(Home)
Go(Record shop)
At(Record shop)
Go(Bakers shop)
At(Bakers shop)
Go(Home)
Step 3 Step 1
precondition
precondition
Step 1 Step 2
precondition Step 3
Step 2 precondition
A Partial-Order Planning
Algorithm (1)
POP algorithm
Starts with minimal partial plan (starts with
goals that must be achieved)
Extends the plan by achieving a precondition
of a needed step (find operators)
(Some operator that achieves the precondition
is chosen either from the existing steps of the
plan or from the set of operators)
A Partial-Order Planning
Algorithm (2)
Records the causal link for the newly
achieved precondition
If the new step threatens an existing
causal link or an existing step threatens
the new causal link the threat resolving
is applied
If at any point the algorithm fails to find a
relevant operator or resolve a threat, it
backtracks to a previous choice point
If all the preconditions of all the steps
are achieved, it is a solution
A Partial-Order Planning
Algorithm (3)