toimenpiteiden suunnittelu (planning, 11.1-3) - cs.helsinki.fi · toimenpiteiden suunnittelu...

11
1 Toimenpiteiden suunnittelu (Planning, 11.1-3) Eero Hyvönen Helsingin yliopisto Tekoäly, Eero Hyvönen, 2004 2 Classical Planning Problem Consider fully observable, deterministic, finite, static, and discrete environments Determine action sequences: initial state -> goal – Search algorithms can be used Dealing with large real world problems – Ignoring irrelevant actions • Must be goal driven – Finding good heuristics By the agent itself? – Exploiting problem structure Planning at different levels of abstraction • Decomposable plans would be nice • Partial order plans can often be determined

Upload: truongnga

Post on 26-Jul-2018

216 views

Category:

Documents


0 download

TRANSCRIPT

1

Toimenpiteiden suunnittelu(Planning, 11.1-3)

Eero HyvönenHelsingin yliopisto

Tekoäly, Eero Hyvönen, 2004 2

Classical Planning Problem• Consider fully observable, deterministic, finite, static, and

discrete environments• Determine action sequences: initial state -> goal

– Search algorithms can be used• Dealing with large real world problems

– Ignoring irrelevant actions• Must be goal driven

– Finding good heuristics• By the agent itself?

– Exploiting problem structure• Planning at different levels of abstraction• Decomposable plans would be nice• Partial order plans can often be determined

2

Tekoäly, Eero Hyvönen, 2004 3

Language for Planning ProblemsClassical STRIPS language

• Representation of states– Conjunction of positive literals (ground, function free)

• At(Plane1, Helsinki) & At(Plane2, NewYrok) & …– Closed World Assumption made

• Representation of goals– As above: set of positive literals– A state s statisfies a goal g if g subsetOf s

• Representation of actions– Action schema:

• Actions are rules on states: Preconditions -> Effects• Action(Fly(p,from,to)),

PRECOND: At(p,from) & Plane(p) & Airport(from) & Airport(to)EFFECT: ¬At(p,from) & At(p,to)

• Effect can be specified also in terms of ”addlist” and ”delete list”– STRIPS assumption (cf. frame problem):

• Every literal not mentioned in the action remains unchanged• Solution = sequence of actions to the goal (possibly partial ordering)

Tekoäly, Eero Hyvönen, 2004 4

Extensions to STRIPS• Action Description Language ADL

– Also negative literals in states– Open world assumption– Quantified variables in goals– Disjunctions in goals– Equality predicate allowed– Variables can have types (e.g. p: plane)– …

• Planning Domain Definition Language (PDDL)– Contains e.g. STRIPS and ADL– For sharing problems

• Missing features– Ramification problem (side effects)– Qualification problem (exceptional effects causing failure)

3

Tekoäly, Eero Hyvönen, 2004 5

Example: Cargo Transportation

Tekoäly, Eero Hyvönen, 2004 6

Planning forward (progression) & backward (regression)

4

Tekoäly, Eero Hyvönen, 2004 7

• Progression: forward planning– Problem of irrelevant actions

• Regression: backward planning– Focuses in relevant actions– Predecessor must include preconditions– Subgoal not present in the predecessor

• Avoid loops– Actions not undo desired literals

• e.g. Load(C2, P1) negates At(C2,B)

Tekoäly, Eero Hyvönen, 2004 8

Heuristics

• Using relaxed problems -> admissibleheuristics– E.g. ignore preconditions– E.g. remove negative effects

• Assume independent subproblems– Can be optimistic (admissible)

• Negative interactions between subgoals– An achieved goal deleted by another subproblem

– Can be pessimistic (inadmissible)• Redundant work in subproblems

5

Tekoäly, Eero Hyvönen, 2004 9

Partial-Order Planning• Problems of forward/backward search: total order plans

– Strictly linear action sequences– Cannot exploit problem decomposition

• Working on several subgoals• Combining subplans together

• Least commitment strategy– Delaying unnecessary choices during search– Generally useful principle in AI!

• Partial planner– Can place two actions in a plan without specifying their mutual

ordering– -> multiple plan linearizations– Search in the space of partial plans, not in the actual state space

Tekoäly, Eero Hyvönen, 2004 10

Components of a Plan• A set of actions that make up the plan

– Empty plan: • Start: Preconditions={}; Effect=initial state• Finish: Preconditions=goal state; Effect={}

• A set of ordering constraints– Partial orderings: A < B– A < B and B < A would be a contradiction

• A set of causal links– A →p B, ”A achieves p for B”

• p is the effect of action A and a precondition of action B

• A set P of open preconditions– Planner tries to reduce P to {} without in introducing

contradictions

6

Tekoäly, Eero Hyvönen, 2004 11

Example: Putting Shoes On• Goal(RightShoeOn & LeftShoeOn)• Init()• Actions

– Action(RightSock, Effect: RightSockOn)– Action(LeftSock, Effect: LeftSockOn)– Action(RightShoe, Precond: RightSockOn, Effect: RightShoeOn)– Action(LeftShoe, Precond: LeftSockOn, Effect: LeftShoeOn)

Tekoäly, Eero Hyvönen, 2004 12

A Partial-order Plan

7

Tekoäly, Eero Hyvönen, 2004 13

The Components• Actions: {RightSock, RightShoe,

LeftSock, LeftShoe, Start, Finish}

Orderings:{RightSock<RightShoe,LeftSock<LeftShoe}

Links:{RightSock→RightSockOnRightShoe,LeftSock→LeftSockOnLeftShoe,RightShoe→RightShoeOnFinish, LeftShoe→LeftShoeOnFinish}

Open preconditions:{}

Tekoäly, Eero Hyvönen, 2004 14

• Consistent plan– No cycles in ordering constraints– No conflicts with the clausal links

• Solution = – consistent plan– open proconditions={}

• Plan execution– Any total ordering can be selected– Flexible in varying situations

8

Tekoäly, Eero Hyvönen, 2004 15

POP as a Search Problem• Initial plan:

– Actions:{Start, Finish}– Orderings:{Start<Finish}– Links:{}– Open precond. = proconditions of Finish

• Successor function– Pick an open procond. p and select an action for

achieving it: A →p B– Consistency enforcing

• Add A<B to plan (if needed, also Start<A, A<Finish)• If an action C has effect ¬p, reschedule B<C or C<A

• Goal test: Open precond. = {}

Tekoäly, Eero Hyvönen, 2004 16

Example

9

Tekoäly, Eero Hyvönen, 2004 17

• Pick the only precond. At(Spare,Axle)-> Action PutOn(Spare, Axle)

• Pick At(Spare,Ground)-> Action remove(Spare,Trunk)

Tekoäly, Eero Hyvönen, 2004 18

• Pick ¬At(Flat,Axle): action LeaveOvernight• Conflict -> Reschedule -> Conflict 2

10

Tekoäly, Eero Hyvönen, 2004 19

• At(Spare,Trunk) in conflict with LeaveOvernight-> LeaveOvernight cannot be chosen at all in the plan

• New try Remove(Flat, Axle) for precondition¬At(Flat,Axle) will lead to the solution

Tekoäly, Eero Hyvönen, 2004 20

Final Solution

11

Tekoäly, Eero Hyvönen, 2004 21

Complications

• Variables in actions– Delayed unification needed– Additional inequality contraints for consistency

can be used• Heuristics for successor function

– Harder to estimate how far the plan is from a solution

Tekoäly, Eero Hyvönen, 2004 22

Lähteet

• S. Russell, P. Norvig: Artificial Intelligence, a Modern Approach. Prentice-Hall, 2003.

• S. Russell, Tekoälykurssin kalvot Berkleynyliopistossa, 2004.