Lecture slides forLecture slides for Automated Planning: Theory...

23
Lecture slides for Lecture slides for Automated Planning: Theory and Practice It d ti t At t dPl i Introduction to Automated Planning Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License: http://creativecommons.org/licenses/by-nc-sa/2.0/ 1

Transcript of Lecture slides forLecture slides for Automated Planning: Theory...

Page 1: Lecture slides forLecture slides for Automated Planning: Theory …ocorcho/Asignaturas/ModelosRazonamien... · 2016. 7. 26. · 02 Dry board in oven at 85 deg. F 005 B EC1 30.00 0.48

Lecture slides forLecture slides forAutomated Planning: Theory and Practice

I t d ti t A t t d Pl iIntroduction to Automated Planning

Dana Nau: Lecture slides for Automated PlanningLicensed under the Creative Commons Attribution-NonCommercial-ShareAlike License: http://creativecommons.org/licenses/by-nc-sa/2.0/ 1

Page 2: Lecture slides forLecture slides for Automated Planning: Theory …ocorcho/Asignaturas/ModelosRazonamien... · 2016. 7. 26. · 02 Dry board in oven at 85 deg. F 005 B EC1 30.00 0.48

4. A drawing or diagram made to scale showing the structure or

plan n.1 A h th d scale showing the structure or

arrangement of something.5. In perspective rendering, one of

1. A scheme, program, or method worked out beforehand for the accomplishment of an objective: a

several imaginary planes perpendicular to the line of vision between the viewer and the object

plan of attack.2. A proposed or tentative project or

course of action: had no plans for jbeing depicted.

6. A program or policy stipulating a service or benefit: a pension plan

course of action: had no plans for the evening.

3. A systematic arrangement of service or benefit: a pension plan.

Synonyms: blueprint, design, project, scheme, strategy

elements or important parts; a configuration or outline: a seating plan; the plan of a story.

Dana Nau: Lecture slides for Automated PlanningLicensed under the Creative Commons Attribution-NonCommercial-ShareAlike License: http://creativecommons.org/licenses/by-nc-sa/2.0/ 2

gy

Page 3: Lecture slides forLecture slides for Automated Planning: Theory …ocorcho/Asignaturas/ModelosRazonamien... · 2016. 7. 26. · 02 Dry board in oven at 85 deg. F 005 B EC1 30.00 0.48

plan n.1. A scheme,

program, or method worked out beforehand f thfor the accomplishment of an objective:of an objective: a plan of attack.

Dana Nau: Lecture slides for Automated PlanningLicensed under the Creative Commons Attribution-NonCommercial-ShareAlike License: http://creativecommons.org/licenses/by-nc-sa/2.0/ 3

Page 4: Lecture slides forLecture slides for Automated Planning: Theory …ocorcho/Asignaturas/ModelosRazonamien... · 2016. 7. 26. · 02 Dry board in oven at 85 deg. F 005 B EC1 30.00 0.48

plan n.2. A proposed or tentative project or course of action:

had no plans for the evening.

Dana Nau: Lecture slides for Automated PlanningLicensed under the Creative Commons Attribution-NonCommercial-ShareAlike License: http://creativecommons.org/licenses/by-nc-sa/2.0/ 4

Page 5: Lecture slides forLecture slides for Automated Planning: Theory …ocorcho/Asignaturas/ModelosRazonamien... · 2016. 7. 26. · 02 Dry board in oven at 85 deg. F 005 B EC1 30.00 0.48

02 Clamp board 03 Establish datum point at bullseye (0.25, 1.00)

004 B VMC1 0.10 0.34 01 Install 0.15-diameter side-milling tool

02 Rough side-mill pocket at (-0.25, 1.25)length 0.40, width 0.30, depth 0.50

[a representation] of future b h i ll f

length 0.40, width 0.30, depth 0.50

03 Finish side-mill pocket at (-0.25, 1.25)

length 0.40, width 0.30, depth 0.50 04 Rough side-mill pocket at (-0.25, 3.00)

behavior … usually a set ofactions, with temporal and other constraints on them length 0.40, width 0.30, depth 0.50

05 Finish side-mill pocket at (-0.25, 3.00) length 0.40, width 0.30, depth 0.50

004 C VMC1 0.10 1.54 01 Install 0.08-diameter end-milling tool

other constraints on them,for execution by some agentor agents. - Austin Tate g

[...]004 T VMC1 2.50 4.87 01 Total time on VMC1

005 A EC1 0.00 32.29 01 Pre-clean board (scrub and wash)

g[MIT Encyclopedia of theCognitive Sciences, 1999]

02 Dry board in oven at 85 deg. F

005 B EC1 30.00 0.48 01 Setup 02 Spread photoresist from 18000 RPM spinner

005 1 30 00 2 00 01005 C EC1 30.00 2.00 01 Setup

02 Photolithography of photoresist using phototool in "real.iges"

005 D EC1 30.00 20.00 01 Setup

02 Etching of copper005 T EC1 90.00 54.77 01 Total time on EC1

006 A MC1 30 00 4 57 01 Setup

Dana Nau: Lecture slides for Automated PlanningLicensed under the Creative Commons Attribution-NonCommercial-ShareAlike License: http://creativecommons.org/licenses/by-nc-sa/2.0/ 5

006 A MC1 30.00 4.57 01 Setup 02 Prepare board for soldering

006 B MC1 30.00 0.29 01 Setup

02 Screenprint solder stop on board006 C MC1 30 00 7 50 01 Setup

A portion of a manufacturing process plan

Page 6: Lecture slides forLecture slides for Automated Planning: Theory …ocorcho/Asignaturas/ModelosRazonamien... · 2016. 7. 26. · 02 Dry board in oven at 85 deg. F 005 B EC1 30.00 0.48

Generating Plans of Action

Computer programs to aid human plannersj ( f )Project management (consumer software)

Plan storage and retrieval Processes:

Opn A BC/WW Setup Runtime LN Description001 A VMC1 2.00 0.00 01 Orient board

02 Clamp board

03 Establish datum point at bullseye (0.25, 1.00)001 B VMC1 0 10 0 43 01 Install 0 30-diameter drill bit

» e.g., variant process planning in manufacturingAutomatic schedule generation

001 B VMC1 0.10 0.43 01 Install 0.30 diameter drill bit

02 Rough drill at (1.25, -0.50) to depth 1.00

03 Finish drill at (1.25, -0.50) to depth 1.00001 C VMC1 0.10 0.77 01 Install 0.20-diameter drill bit

02 Rough drill at (0.00, 4.88) to depth 1.00

03 Finish drill at (0.00, 4.88) to depth 1.00 [...]

001 T VMC1 2.20 1.20 01 Total time on VMC1[...]

004 A VMC1 2.00 0.00 01 Orient board

02 Clamp board 03 Establish datum point at bullseye (0.25, 1.00)

004 B VMC1 0.10 0.34 01 Install 0.15-diameter side-milling tool

02 Rough side-mill pocket at (-0.25, 1.25) length 0.40, width 0.30, depth 0.50

03 Finish side-mill pocket at (-0.25, 1.25)

length 0.40, width 0.30, depth 0.50 04 Rough side-mill pocket at (-0.25, 3.00)

length 0.40, width 0.30, depth 0.50

05 Finish side-mill pocket at (-0.25, 3.00) length 0.40, width 0.30, depth 0.50

» various OR and AI techniques

For some problems, we would like generate

004 C VMC1 0.10 1.54 01 Install 0.08-diameter end-milling tool

[...]004 T VMC1 2.50 4.87 01 Total time on VMC1

005 A EC1 0.00 32.29 01 Pre-clean board (scrub and wash)

02 Dry board in oven at 85 deg. F

005 B EC1 30.00 0.48 01 Setup 02 Spread photoresist from 18000 RPM spinner

005 C EC1 30.00 2.00 01 Setup

02 Photolithography of photoresist using phototool in "real.iges"

005 D EC1 30.00 20.00 01 Setup

02 Etching of copper005 T EC1 90.00 54.77 01 Total time on EC1

006 A MC1 30.00 4.57 01 Setup 02 Prepare board for soldering

006 B MC1 30.00 0.29 01 Setup

02 Screenprint solder stop on board006 C MC1 30.00 7.50 01 Setup

02 Deposit solder paste at (3.35,1.23) on board using nozzlep , g

plans (or pieces of plans) automaticallyMuch more difficult

p p ( , ) g [...]

31 Deposit solder paste at (3.52,4.00) on board using nozzle

006 D MC1 0.00 5.71 01 Dry board in oven at 85 deg. F to solidify solder paste006 T MC1 90.00 18.07 01 Total time on MC1

[...]

011 A TC1 0.00 35.00 01 Perform post-cap testing on board011 B TC1 0.00 29.67 01 Perform final inspection of board

011 T TC1 0.00 64.67 01 Total time on TC1

999 T 319.70 403.37 01 Total time to manufacture

Automated-planning research is starting to pay offHere are some examples …

Dana Nau: Lecture slides for Automated PlanningLicensed under the Creative Commons Attribution-NonCommercial-ShareAlike License: http://creativecommons.org/licenses/by-nc-sa/2.0/ 6

Page 7: Lecture slides forLecture slides for Automated Planning: Theory …ocorcho/Asignaturas/ModelosRazonamien... · 2016. 7. 26. · 02 Dry board in oven at 85 deg. F 005 B EC1 30.00 0.48

Space ExplorationAutonomous planning, scheduling, control

NASA: Jet Propulsion Lab and Ames Research CenterRemote Agent Experiment (RAX)

Deep Space 1Mars ExplorationRover (MER)

Dana Nau: Lecture slides for Automated PlanningLicensed under the Creative Commons Attribution-NonCommercial-ShareAlike License: http://creativecommons.org/licenses/by-nc-sa/2.0/ 7

Page 8: Lecture slides forLecture slides for Automated Planning: Theory …ocorcho/Asignaturas/ModelosRazonamien... · 2016. 7. 26. · 02 Dry board in oven at 85 deg. F 005 B EC1 30.00 0.48

ManufacturingSheet-metal bending machines - Amada Corporation

Software to plan the sequence of bendsSoftware to plan the sequence of bends[Gupta and Bourne, J. Manufacturing Sci. and Engr., 1999]

Dana Nau: Lecture slides for Automated PlanningLicensed under the Creative Commons Attribution-NonCommercial-ShareAlike License: http://creativecommons.org/licenses/by-nc-sa/2.0/ 8

Page 9: Lecture slides forLecture slides for Automated Planning: Theory …ocorcho/Asignaturas/ModelosRazonamien... · 2016. 7. 26. · 02 Dry board in oven at 85 deg. F 005 B EC1 30.00 0.48

GamesBridge Baron - Great Game Products

1997 world champion of computer bridge [S i h N d Th AI M i 1998][Smith, Nau, and Throop, AI Magazine, 1998]2004: 2nd place

Fi (P S)Us:East declarer, West dummyOpponents:defenders South & NorthFinesse(P1; S) Opponents:defenders, South & NorthContract:East – 3NTOn lead:West at trick 3 East:♠KJ74

West: ♠A2LeadLow(P1; S) FinesseTwo(P2; S) Out: ♠QT98653

(North— ♠Q)… …

PlayCard(P1; S, R1) EasyFinesse(P2; S) BustedFinesse(P2; S)StandardFinesse(P2; S)

(North— 3)West— ♠2

(North ♠Q)

FinesseFour(P4; S)StandardFinesseTwo(P2; S) StandardFinesseThree(P3; S)

(North 3)

Dana Nau: Lecture slides for Automated PlanningLicensed under the Creative Commons Attribution-NonCommercial-ShareAlike License: http://creativecommons.org/licenses/by-nc-sa/2.0/ 9

PlayCard(P3; S, R3)PlayCard(P2; S, R2) PlayCard(P4; S, R4) PlayCard(P4; S, R4’)

East— ♠JNorth— ♠3 South— ♠5 South— ♠Q

Page 10: Lecture slides forLecture slides for Automated Planning: Theory …ocorcho/Asignaturas/ModelosRazonamien... · 2016. 7. 26. · 02 Dry board in oven at 85 deg. F 005 B EC1 30.00 0.48

Conceptual Model1 Environment1. Environment

State transition systemState transition systemΣ = (S,A,E,γ)

S = {states}

System Σ

A = {actions}E = {exogenous events}γ = state transition function

Dana Nau: Lecture slides for Automated PlanningLicensed under the Creative Commons Attribution-NonCommercial-ShareAlike License: http://creativecommons.org/licenses/by-nc-sa/2.0/ 10

γ = state-transition function

Page 11: Lecture slides forLecture slides for Automated Planning: Theory …ocorcho/Asignaturas/ModelosRazonamien... · 2016. 7. 26. · 02 Dry board in oven at 85 deg. F 005 B EC1 30.00 0.48

State Transition System

put

s0s1

Σ = (S,A,E,γ)

Systemtake

location 1 location 2location 1 location 2

S = {states}A = {actions}

t

move1move1move2 move2

s3 s2

E = {exogenous events}State-transition function

put

take

γ: S x (A ∪ E) → 2S

S = {s0, …, s5}loadunload

s s

location 1 location 2 location 1 location 2

S {s0, …, s5}A = {move1, move2, put, take, load, unload}

move2

s4 s5

p , , , }E = {}γ: see the arrows

move1

location 1 location 2 location 1 location 2

Dana Nau: Lecture slides for Automated PlanningLicensed under the Creative Commons Attribution-NonCommercial-ShareAlike License: http://creativecommons.org/licenses/by-nc-sa/2.0/ 11

γThe Dock Worker Robots (DWR) domain

Page 12: Lecture slides forLecture slides for Automated Planning: Theory …ocorcho/Asignaturas/ModelosRazonamien... · 2016. 7. 26. · 02 Dry board in oven at 85 deg. F 005 B EC1 30.00 0.48

Conceptual Model2 Controller2. Controller

Given observation ControllerObservation functionh: S → O

o in O, produces action a in A

Controller

s3

location 1 location 2

Dana Nau: Lecture slides for Automated PlanningLicensed under the Creative Commons Attribution-NonCommercial-ShareAlike License: http://creativecommons.org/licenses/by-nc-sa/2.0/ 12

location 1 location 2

Page 13: Lecture slides forLecture slides for Automated Planning: Theory …ocorcho/Asignaturas/ModelosRazonamien... · 2016. 7. 26. · 02 Dry board in oven at 85 deg. F 005 B EC1 30.00 0.48

Conceptual Model3 Planner’s Input

Planning problemPlanning problemPlanning problem

3. Planner’s Input

Omit unlessPlanner

Omit unless planning is online

Dana Nau: Lecture slides for Automated PlanningLicensed under the Creative Commons Attribution-NonCommercial-ShareAlike License: http://creativecommons.org/licenses/by-nc-sa/2.0/ 13

Page 14: Lecture slides forLecture slides for Automated Planning: Theory …ocorcho/Asignaturas/ModelosRazonamien... · 2016. 7. 26. · 02 Dry board in oven at 85 deg. F 005 B EC1 30.00 0.48

PlanningP bl

put

s0s1

Problemtake

location 1 location 2location 1 location 2Description of Σ

t

move1move1move2 move2

s3 s2

Description of ΣInitial state or set of states

put

take

Initial state = s0Objective

G l floadunload

s s

location 1 location 2 location 1 location 2Goal state, set of goal states, set of tasks “trajectory” of

move2

s4 s5tasks, trajectory of states, objective function, …

move1

location 1 location 2 location 1 location 2

,Goal state = s5

Dana Nau: Lecture slides for Automated PlanningLicensed under the Creative Commons Attribution-NonCommercial-ShareAlike License: http://creativecommons.org/licenses/by-nc-sa/2.0/ 14

The Dock Worker Robots (DWR) domain

Page 15: Lecture slides forLecture slides for Automated Planning: Theory …ocorcho/Asignaturas/ModelosRazonamien... · 2016. 7. 26. · 02 Dry board in oven at 85 deg. F 005 B EC1 30.00 0.48

Conceptual Model4 Planner’s Output4. Planner’s Output

Instructions tothe controller

Plannerthe controller

Dana Nau: Lecture slides for Automated PlanningLicensed under the Creative Commons Attribution-NonCommercial-ShareAlike License: http://creativecommons.org/licenses/by-nc-sa/2.0/ 15

Page 16: Lecture slides forLecture slides for Automated Planning: Theory …ocorcho/Asignaturas/ModelosRazonamien... · 2016. 7. 26. · 02 Dry board in oven at 85 deg. F 005 B EC1 30.00 0.48

Plansput

s0s1

take

location 1 location 2location 1 location 2

Classical plan: a sequence of actions

take

t

move1move1move2 move2

s3 s2

sequence of actions

⟨take, move1, load, move2⟩

move1

put

take

move2⟩

Policy: partial function

loadunload

s s

location 1 location 2 location 1 location 2

Policy: partial function from S into A

{(s take)load

move2

s4 s5{(s0, take),(s1, move1),(s3, load),

move2

move1

location 1 location 2 location 1 location 2

(s3, load),(s4, move2)}

Dana Nau: Lecture slides for Automated PlanningLicensed under the Creative Commons Attribution-NonCommercial-ShareAlike License: http://creativecommons.org/licenses/by-nc-sa/2.0/ 16

The Dock Worker Robots (DWR) domain

Page 17: Lecture slides forLecture slides for Automated Planning: Theory …ocorcho/Asignaturas/ModelosRazonamien... · 2016. 7. 26. · 02 Dry board in oven at 85 deg. F 005 B EC1 30.00 0.48

Planning Versus Scheduling

Scheduling Decide when and how to

Scheduler

Decide when and how to perform a given set of actions

» Time constraints» Time constraints» Resource constraints» Objective functions» Objective functions

Typically NP-complete

PlanningDecide what actions to use to achieve some set of objectivesCan be much worse than NP-complete; worst case is undecidable

Dana Nau: Lecture slides for Automated PlanningLicensed under the Creative Commons Attribution-NonCommercial-ShareAlike License: http://creativecommons.org/licenses/by-nc-sa/2.0/ 17

Page 18: Lecture slides forLecture slides for Automated Planning: Theory …ocorcho/Asignaturas/ModelosRazonamien... · 2016. 7. 26. · 02 Dry board in oven at 85 deg. F 005 B EC1 30.00 0.48

A0: Finite system:

Restrictive AssumptionsA0: Finite system:

finitely many states, actions, eventsA1: Fully observable:

the controller knows Σ’s current stateA2: Deterministic:

each action has only one outcomeeach action has only one outcomeA3: Static (no exogenous events):

no changes but the controller’s actionsA4: Attainment goals:

a set of goal states SgA5: Sequential plans:A5: Sequential plans:

a plan is a linearly ordered sequenceof actions (a1, a2, … an)

A6: Implicit time:A6: Implicit time:no time durations; linear sequence of instantaneous states

A7: Off-line planning:

Dana Nau: Lecture slides for Automated PlanningLicensed under the Creative Commons Attribution-NonCommercial-ShareAlike License: http://creativecommons.org/licenses/by-nc-sa/2.0/ 18

planner doesn’t know the execution status

Page 19: Lecture slides forLecture slides for Automated Planning: Theory …ocorcho/Asignaturas/ModelosRazonamien... · 2016. 7. 26. · 02 Dry board in oven at 85 deg. F 005 B EC1 30.00 0.48

Classical PlanningClassical planning requires all eight restrictive assumptions

Offline generation of action sequences for a deterministic, g q ,static, finite system, with complete knowledge, attainment goals, and implicit time

Reduces to the following problem:Given (Σ, s0, Sg)g

Find a sequence of actions (a1, a2, … an) that produces a sequence of state transitions (s1, s2, …, sn)

h h i i Ssuch that sn is in Sg.This is just path-searching in a graph

Nodes = statesEdges = actions

Dana Nau: Lecture slides for Automated PlanningLicensed under the Creative Commons Attribution-NonCommercial-ShareAlike License: http://creativecommons.org/licenses/by-nc-sa/2.0/ 19

Is this trivial?

Page 20: Lecture slides forLecture slides for Automated Planning: Theory …ocorcho/Asignaturas/ModelosRazonamien... · 2016. 7. 26. · 02 Dry board in oven at 85 deg. F 005 B EC1 30.00 0.48

Classical Planningg

Generalize the earlier example:s1

tp

Five locations, three robot carts,100 containers, three piles take

put

» Then there are 10277 statesNumber of particles in the universe

location 1 location 2

move1move2p

is only about 1087

The example is more than 10190 times as large!

Automated-planning research has been heavily dominated by classical planningclassical planning

Dozens (hundreds?) of different algorithmsI’ll b i fl d ib f f th b t k

Dana Nau: Lecture slides for Automated PlanningLicensed under the Creative Commons Attribution-NonCommercial-ShareAlike License: http://creativecommons.org/licenses/by-nc-sa/2.0/ 20

I’ll briefly describe a few of the best-known ones

Page 21: Lecture slides forLecture slides for Automated Planning: Theory …ocorcho/Asignaturas/ModelosRazonamien... · 2016. 7. 26. · 02 Dry board in oven at 85 deg. F 005 B EC1 30.00 0.48

A running example: Dock Worker Robots

Generalization of the earlier exampleGeneralization of the earlier exampleA harbor with several locations

» e g docks docked ships» e.g., docks, docked ships,storage areas, parking areas

ContainersContainers» going to/from ships

Robot cartsRobot carts» can move containers

CranesCranes» can load and unload containers

Dana Nau: Lecture slides for Automated PlanningLicensed under the Creative Commons Attribution-NonCommercial-ShareAlike License: http://creativecommons.org/licenses/by-nc-sa/2.0/ 21

Page 22: Lecture slides forLecture slides for Automated Planning: Theory …ocorcho/Asignaturas/ModelosRazonamien... · 2016. 7. 26. · 02 Dry board in oven at 85 deg. F 005 B EC1 30.00 0.48

A running example: Dock Worker RobotsLocations: l1, l2, …

Containers: c1 c2Containers: c1, c2, …can be stacked in piles, loaded onto robots, or held by cranes

Pil 1 2Piles: p1, p2, …fixed areas where containers are stackedpallet at the bottom of each pilep p

Robot carts: r1, r2, …can move to adjacent locationsjcarry at most one container

Cranes: k1 k2Cranes: k1, k2, …each belongs to a single locationmove containers between piles and robots

Dana Nau: Lecture slides for Automated PlanningLicensed under the Creative Commons Attribution-NonCommercial-ShareAlike License: http://creativecommons.org/licenses/by-nc-sa/2.0/ 22

if there is a pile at a location, there must also be a crane there

Page 23: Lecture slides forLecture slides for Automated Planning: Theory …ocorcho/Asignaturas/ModelosRazonamien... · 2016. 7. 26. · 02 Dry board in oven at 85 deg. F 005 B EC1 30.00 0.48

A running example: Dock Worker Robots

Fixed relations: same in all statesdj t(l l’) tt h d( l) b l (k l)adjacent(l,l’) attached(p,l) belong(k,l)

Dynamic relations: differ from one state to anotheroccupied(l) at(r,l)loaded(r,c) unloaded(r)holding(k c) empty(k)holding(k,c) empty(k)in(c,p) on(c,c’)top(c,p) top(pallet,p)

Actions:take(c,k,p) put(c,k,p)take(c,k,p) put(c,k,p)load(r,c,k) unload(r) move(r,l,l’)

Dana Nau: Lecture slides for Automated PlanningLicensed under the Creative Commons Attribution-NonCommercial-ShareAlike License: http://creativecommons.org/licenses/by-nc-sa/2.0/ 23