16931fff259b87a88a8d8bb3ae5f945b.ppt
- Количество слайдов: 19
Planning Chapter 11 CS 471/598 by H. Liu Copyright, 1996 © Dale Carnegie & Associates, Inc.
Acting logically z. Problem-solving agents are able to plan ahead before acting (Part II). z. Knowledge-based agents can select actions based on explicit, logical representation of the current state and the effects of actions (Part III). z. We now build planning agents (Part IV). CS 471/598 by H. Liu 2
A simple planning agent z An algorithm (Fig 11. 1, page 338) ycompared to the problem-solving agent in Fig 3. 1 z Percepts z State z Actions z Goal z Plan - a sequence of actions ymust deal with no plan or plan is infeasible CS 471/598 by H. Liu 3
From problem solving to planning z They are different in representing goals, states, and actions, and in ways of constructing action sequences. z For a problem-solving agent, y. Actions - generate successor state descriptions y. State representations for successor generation, heuristic eval function, and goal testing y. Goals used in the goal test and the heuristic function y. Plans - actions from the initial to the goal state CS 471/598 by H. Liu 4
Example z Get milk and bananas and a drill yinitial state: agent is at home without the above yoperator set: all things agent can do yheuristic function: the things that haven’t yet been acquired z Fig 11. 2 - a small part of the first two levels of the search space CS 471/598 by H. Liu 5
Example (cont) z Problems with search agent y. Too many actions and too many states to consider y. Heuristic function can only choose among states and can’t eliminate actions from consideration; so which action should be taken? y. Agent is forced to consider actions starting from the initial state. CS 471/598 by H. Liu 6
Solutions to the problems z Open up the representation of states, goals, actions y. States and goals are represented by sets of sentences; actions by logical descriptions of preconditions and effects -> direct connections between states and actions. z Planner is free to add actions to the plan wherever they are needed y. So it can make obvious and important decisions first, others later z Most parts of the world are independent of each other -> so we can solve it independently (Div&Conq) CS 471/598 by H. Liu 7
Planning in situation calculus z Initial state: At(H, S 0)^!Have(M, S 0)^!Have(B, S 0)^!Have(D, S 0) z Goal state: there exists s, At(H, s)^Have(M, s)^Have(B, s)^Have(D, s) z Operators: for all a, s Have(M, Result(a, s)) <=> [(a=Buy(M)^At(SM, s) v (Have(M, s)^a!=Drop(M))] z Definition of Result’(l, s) for sequence l yfor all s Result’([], s) = s yfor all a, p, s Result’([a|p], s)=Result’(p, Result(a, s)) CS 471/598 by H. Liu 8
A solution to the shopping problem z. In order to achieve At(Home, Res’(p, S 0))^Have(Milk, Res’(p, S 0))^ Have(Bananas, Res’(p, S 0))^Have(Drill, Res’(p, S 0)) z. What’s the plan p? Go(Sup. Mar), Buy(Milk), Buy(Bananas), Go(Hardwere), Buy(Drill) , Go(Home) z. What are the problems? y. Inefficient (unguided search) y. Irrelevant steps [Nothing|p] and [A, A’|p] CS 471/598 by H. Liu 9
Basic representations z STRIPS language for efficient planning y. States are conjunctions of function-free ground literals At(Home)^!Have(Milk)^!Have(Bananas)^!Have(Drill)^. . . y. Goals are conjunctions of literals, contain variables x. At(Home)^Have(Milk)^… x. At(x)^Sells(x, Milk) y. Implicit representations of states in planning - only changes are tracked. y. Operators in SRIPS have three components: action, precondition, and effect CS 471/598 by H. Liu 10
STRIPS z. A plan is a data structure of the following yplan steps (operators) yordering constraints (Si Sj) yvariable binding constraints ycausal links (Si c Sj) z An example (Fig 11. 3) represents Op(ACTION: Go(there), PRECOND: At(here)^Path(here, th ere), EFFECT: At(there)^!At(here) CS 471/598 by H. Liu 11
STRIPS (2) z Operator Schema - an operator with variables z Applicable operators - precond’s can be met z Progression vs. regression planners z Partial plans are incomplete plans z We can have refinement or modification operators z A solution is a plan that can be executed to achieve the goal CS 471/598 by H. Liu 12
STRIPS (3) z. An example: Right. Shoe. On^Left. Shoe. On y. Fig 11. 4 z Types of order: partial and total y. Least commitment - one should only make necessary choices y. Partial order is of least commitment y. Linearization: from partial to total order y. Why not total order? Fig 11. 5 CS 471/598 by H. Liu 13
z A plan is complete if every precondition of every step is achieved by some other step. y. A step achieves a condition if the condition is one of the effects of the step. y. The need for promotion and demotion (Fig 11. 10) y. The causal link to protect a precond z A plan is consistent if there are no contradictions in the ordering or binding constraints. y. Ordering is transitive CS 471/598 by H. Liu 14
Partial-order planning (POP) z Revisit the shopping example y. Initial state: Op(Action: Start, Effect: At(home)^Sells(HWS, Drill)^ Sells(SM, Milk), Sells(SM, Bananas)) y. We have Go and Buy actions Op(Action: Go(there), Precond: At(here), Effect: At(there)^!At(here)) Op(Action: Buy(x), Precond: At(store)^Sells(store, x), Effect: Have(x)) y. Goal state: Op(Action: Finish, Precond: At(home)^Have(Drill)^ Have(Milk), Have(Bananas)) z Let’s plan. . . CS 471/598 by H. Liu 15
Partial-order planning (Algorithm) z. Algorithm - Fig 11. 13 z. It’s nondeterministic z. It starts with a minimal partial plan. z. It satisfies one precond at a time. z. POP is a regression planner. z. POP is sound and complete. CS 471/598 by H. Liu 16
Partially instantiated operators z Dealing with variable binding constraints y. Is !At(x) a threat to the condition At(Home)? y. It’s a possible threat x. Resolve now with an equality constraint, At(HWS) x. Resolve now with an inequality constraint, x!=Home x. Resolve later => partially instantiated opererators y. Modified POP in Fig 11. 14, p 358 z Full instantiation of operators before returning a plan CS 471/598 by H. Liu 17
More examples on planning z The blocks world y. On(b, x), Move(b, x, y), Clear(x) y. Op(Action: Move(b, x, y), Precond: On(b, x)^Clear(b)^Clear(y), Effect: On(b, y)^Clear(x)^!On(b, x)^!Clear(y)) y. What if y is a table? Clear(Table)? y. Op(Action: Move. To. Table(b, x), Precond: On(b, x)^Clear(b), Effect: On(b, Table)^Clear(x)^!On(b, x)) z Shakey’s world (Fig 11. 15) - the domain for STRIPS CS 471/598 by H. Liu 18
Summary z Planning uses more flexible representations of state, actions, goals, and plans z STRIPS - a specific language that connects states to actions (action, precond, effect) z Search through the plan space - regression z Least commitment: partial ordering & instantiation z Causal links: protect rewriting & detect conflicts early CS 471/598 by H. Liu 19
16931fff259b87a88a8d8bb3ae5f945b.ppt