SlideShare a Scribd company logo
1 of 18
Download to read offline
1"Dana"Nau"and"Vikas"Shivashankar:"Lecture"slides"for!Automated!Planning!and!Ac0ng" Updated"3/24/15"
This"work"is"licensed"under"a"CreaCve"Commons"AFribuConHNonCommercialHShareAlike"4.0"InternaConal"License."
Chapter(3((
Delibera.on(with(Refinement(Methods(
(
Ac.ng((Sec.ons(3.1–3.3)(
Dana S. Nau and Vikas Shivashankar
University of Maryland
2"Dana"Nau"and"Vikas"Shivashankar:"Lecture"slides"for!Automated!Planning!and!Ac0ng" Updated"3/24/15"
ungrasp
grasp
knob
turn
knob
maintain
move
back
pull
monitor
identify
type
of
door
pull
monitor
move
close
to
knob
open door
……
get out close door
respond to user requests
……
bring o7 to room2
go to
hallway
deliver
o7
…… … …
…
move to door
fetch
o7
navigate
to room2
navigate
to room1
Mo.va.on(
●  Actor is hierarchically organized
●  Suppose a node of the tree contains
an action a
●  At the next level down, a is a task
that needs to be performed
!  Recursively refine
tasks into subtasks
●  Dashed blue lines:
!  A CSV planner can do the
refinement
●  Solid red lines:
!  need other techniques
●  A refinement method is
an operational model
!  A program to compute
a refinement
!  Actor can use it online
3"Dana"Nau"and"Vikas"Shivashankar:"Lecture"slides"for!Automated!Planning!and!Ac0ng" Updated"3/24/15"
Nota.on(and(Terminology(
●  Recall from Chapter 2 that the actor’s state ξ may differ from the state s that the
actor gives to the planner
!  ξ is the actor’s current state; execution platform keeps it up-to-date
!  Ξ = {all possible states}
●  Fact: an atom that’s true in the current state
●  Task: an activity that the actor needs to carry out
●  State variable: like a CSV state variable, but its range more general
!  If x is a state variable, Range(x) can be finite, infinite, continuous,
discontinuous, vectors, matrices, other data structures
●  Assignment: more general than a CSV assignment
!  x ← expr where expr returns a ground value in Range(x) and expr has no
side-effects on the current state
●  Tests (e.g., preconditions)
!  Simple test: x = v, x ≠ v, x > v, x < v
!  Compound test: conjunction, disjunction, or negation of simple tests
4"Dana"Nau"and"Vikas"Shivashankar:"Lecture"slides"for!Automated!Planning!and!Ac0ng" Updated"3/24/15"
Example(
●  Objects
!  Robots = {rbt}, Containers = {c1, c2, …}, Locations = {loc1, loc2, …}.
●  State variables
!  loc(r) ∈ Locations
!  load(r) ∈ Containers ⋃ {nil}
!  pos(c) ∈ Locations ⋃ Robots ⋃ {unknown}
!  view(l) ∈ {T, F}
•  whether the robot has looked at location l or not
•  If view(l)=T then for every container c in l, pos(c) = l
●  Commands to the execution platform:
!  take(r,o): r takes object o
!  put(r,o): r puts o
!  perceive(r,l): robot r perceives what objects are at a location l
5"Dana"Nau"and"Vikas"Shivashankar:"Lecture"slides"for!Automated!Planning!and!Ac0ng" Updated"3/24/15"
Refinement(Methods(
●  Refinement method: a triple (task or event, precondition, body)
!  a task or event that the method can be used for
!  precondition that needs to be true for the method to be applicable
!  body: a program
●  Write in the following format:
method-name(arg1, …, argk) method-name(arg1, …, argk)
task: task event: event
pre: precondition pre: precondition
body: body body: body
●  body: sequence of steps
!  assignments, commands, tasks
!  control constructs: if-then-else, while, loop, etc.
6"Dana"Nau"and"Vikas"Shivashankar:"Lecture"slides"for!Automated!Planning!and!Ac0ng" Updated"3/24/15"
Con.nue(Previous(Example(
●  Task: fetch container c
●  Method: if you know c’s location, then go get it; else search
mHfetch(r,c)
task: fetch(r,c)
pre:
body: if pos(c) = unknown then search(r,c)
else if loc(r) = pos(c) then take(r,c)
else do
goto(r,pos(c))
take(r,c)
mHsearch(r,c)
task: search(r,c)
pre: pos(c) = unknown
body: if ∃l (view(l)=F) then
goto(r,l)
perceive(l)
if pos(c)=l then take(r,c)
else search(r,c)
else fail
start
monitor
opendoor(r1,d3)
m-fetch(…)
take(r1,o7)
move
close to
handle
m-pull-open(r1,loc3,d3,d3h)
goto(r1,loc4) closedoor(r1,d3)
unlatch throw wide end
monitor
goto(r1,loc1)
fetch(r1,o7)
… methods for other
kinds of doors
m-go-to-hallway(r1,d3,loc1)
goto(r1,loc1)
…
methods
for other
kinds of
routes
m2
i1
i2
m1
m3
7"Dana"Nau"and"Vikas"Shivashankar:"Lecture"slides"for!Automated!Planning!and!Ac0ng" Updated"3/24/15"
Con.nue(Previous(Example(
●  Task: go to location m
●  Method: if there’s a door to a hallway,
then go through the door then proceed to m
mHgoHtoHhallway(r,l,m)
task: goto(r,m)
pre: loc(r)=l, door(d,l,h),
type(h,hallway), status(d)=closed"
body: openHdoor(r,d)
goto(r,h)
close(r,d)
goto(r,m)
start
monitor
opendoor(r1,d3)
m-fetch(…)
take(r1,o7)
move
close to
handle
m-pull-open(r1,loc3,d3,d3h)
goto(r1,loc4) closedoor(r1,d3)
unlatch throw wide end
monitor
goto(r1,loc1)
fetch(r1,o7)
… methods for other
kinds of doors
m-go-to-hallway(r1,d3,loc1)
goto(r1,loc1)
…
methods
for other
kinds of
routes
m2
i1
i2
m1
m3
8"Dana"Nau"and"Vikas"Shivashankar:"Lecture"slides"for!Automated!Planning!and!Ac0ng" Updated"3/24/15"
Con.nue(Previous(Example(
●  Event: emergency call
!  Stop current activity, go where the emergency is
●  Another state variable
!  emergencyHhandling(r) ∈ {T, F}
•  whether r is handling an emergency
●  Method:
mHemergency(r,l,i)
event: emergency(l,i)
pre: emergencyHhandling=F
body: emergencyHhandling ← T
if loaded(r) ≠ nil"then
" "put(r,load(r))
goto(l)
addressHemergency(l,i)
start
monitor
opendoor(r1,d3)
m-fetch(…)
take(r1,o7)
move
close to
handle
m-pull-open(r1,loc3,d3,d3h)
goto(r1,loc4) closedoor(r1,d3)
unlatch throw wide end
monitor
goto(r1,loc1)
fetch(r1,o7)
… methods for other
kinds of doors
m-go-to-hallway(r1,d3,loc1)
goto(r1,loc1)
…
methods
for other
kinds of
routes
m2
i1
i2
m1
m3
9"Dana"Nau"and"Vikas"Shivashankar:"Lecture"slides"for!Automated!Planning!and!Ac0ng" Updated"3/24/15"
Con.nue(Previous(Example(
●  Commands used for opening a door
!  moveHclose(r,o): r moves to a position
where reachable(r,o)=T"
!  moveHby(r,λ): r moves with magnitude and
direction given by vector λ
!  grasp(r,o): r grasps object o
!  ungrasp(r,o): r release grasp on o
!  turn(r,o,α): r turns a grasped object
o by angle α ∈ [−π,+π]
!  pull(r,λ): r pulls its arm by vector λ
!  push(r,λ): r pushes its arm by λ
!  monitorHstatus(r,d):
r focuses its perception to
keep doorHstatus"updated
(starts a process)
!  endHmonitorHstatus(r,d):
r stops monitoring d
(terminates a process) start
monitor
opendoor(r1,d3)
m-fetch(…)
take(r1,o7)
move
close to
handle
m-pull-open(r1,loc3,d3,d3h)
goto(r1,loc4) closedoor(r1,d3)
unlatch throw wide end
monitor
goto(r1,loc1)
fetch(r1,o7)
… methods for other
kinds of doors
m-go-to-hallway(r1,d3,loc1)
goto(r1,loc1)
…
methods
for other
kinds of
routes
m2
i1
i2
m1
m3
10"Dana"Nau"and"Vikas"Shivashankar:"Lecture"slides"for!Automated!Planning!and!Ac0ng" Updated"3/24/15"
Con.nue(Previous(Example(
●  Task: open the door
mHopendoor(r,d,l,h)""
task: opendoor(r,d)""
pre: loc(r)"="l"∧"adjacent(l,d)"∧"handle(d,h)""
"body: while ¬reachable(r,h)"do
" " "moveHclose(r,h)""
" "monitorHstatus(r,d)""
" "if doorHstatus(d)=closed"then
unlatch(r,d) "
" "throwHwide(r,d)
" "endHmonitorHstatus(r,d)
"
start
monitor
opendoor(r1,d3)
m-fetch(…)
take(r1,o7)
move
close to
handle
m-pull-open(r1,loc3,d3,d3h)
goto(r1,loc4) closedoor(r1,d3)
unlatch throw wide end
monitor
goto(r1,loc1)
fetch(r1,o7)
… methods for other
kinds of doors
m-go-to-hallway(r1,d3,loc1)
goto(r1,loc1)
…
methods
for other
kinds of
routes
m2
i1
i2
m1
m3
11"Dana"Nau"and"Vikas"Shivashankar:"Lecture"slides"for!Automated!Planning!and!Ac0ng" Updated"3/24/15"
Con.nue(Previous(Example(
m1Hunlatch(r,d,l,o)
task: unlatch(r,d)
pre: loc(r,l) ∧ towardHside(l,d) ∧ side(d,leX)
∧ type(d,rotate) ∧ handle(d,h)
body: grasp(r,h)
turn(r,h,alpha1)
pull(r,val1)
if doorHstatus(d)≠cracked"then fail"
"
m1-throw-wide(r,d,l,h)
task: throwHwide(r,d)
pre: loc(r,l) ∧ towardHside(l,d)
∧ side(d,leX) ∧ type(d,rotate)
∧ handle(d,h) ∧ grasping(r)=d
∧ doorHstatus(d)=cracked"
body: pull(r,val1)
moveHby(r,val2)
ungrasp(r,h)
"
start
monitor
opendoor(r1,d3)
m-fetch(…)
take(r1,o7)
move
close to
handle
m-pull-open(r1,loc3,d3,d3h)
goto(r1,loc4) closedoor(r1,d3)
unlatch throw wide end
monitor
goto(r1,loc1)
fetch(r1,o7)
… methods for other
kinds of doors
m-go-to-hallway(r1,d3,loc1)
goto(r1,loc1)
…
methods
for other
kinds of
routes
m2
i1
i2
m1
m3
12"Dana"Nau"and"Vikas"Shivashankar:"Lecture"slides"for!Automated!Planning!and!Ac0ng" Updated"3/24/15"
Refinement(Ac.ng(Engine((RAE)(
●  Based on OpenPRS
!  Programming language, open source
software used widely in robotics
●  Input:
!  facts, external tasks, events, current
state
●  Output:
!  commands to execution platform
Acting
tasks
Execution Platform
Environment
eventscommands
!M
13"Dana"Nau"and"Vikas"Shivashankar:"Lecture"slides"for!Automated!Planning!and!Ac0ng" Updated"3/24/15"
●  Perform external tasks and events
in parallel
!  For each, a refinement stack
● Agenda = {current stacks}
Acting
tasks
Execution Platform
Environment
eventscommands
!M
Refinement(Ac.ng(Engine((RAE)(
14"Dana"Nau"and"Vikas"Shivashankar:"Lecture"slides"for!Automated!Planning!and!Ac0ng" Updated"3/24/15"
Refinement(Stacks(in(RAE(
●  Refinement stack:
!  (opendoor(r1,d3), mHpullHopen(r1,d3,loc2,d3h), i1, {m3})
!  (goto(r1,loc1), mHgoHtoHhallway(r1,d3,loc1), i2, {m1,m2})
!  (fetch(r1,o7), mHfetch(…), nil, ∅)
●  Corresponds to a path from the
current node back to the root
●  Each element is a 4-tuple (τ,m,i,tried)
!  τ: task or event
!  m: current method for τ
!  i: execution pointer for body(m)
•  τ[i] = instruction that’s
currently executing
•  i is initially nil
!  tried: methods RAE has
already tried for m start
monitor
opendoor(r1,d3)
m-fetch(…)
take(r1,o7)
move
close to
handle
m-pull-open(r1,loc3,d3,d3h)
goto(r1,loc4) closedoor(r1,d3)
unlatch throw wide end
monitor
goto(r1,loc1)
fetch(r1,o7)
… methods for other
kinds of doors
m-go-to-hallway(r1,d3,loc1)
goto(r1,loc1)
…
methods
for other
kinds of
routes
m2
i1
i2
m1
m3
15"Dana"Nau"and"Vikas"Shivashankar:"Lecture"slides"for!Automated!Planning!and!Ac0ng" Updated"3/24/15"
start
monitor
opendoor(r1,d3)
m-fetch(…)
take(r1,o7)
move
close to
handle
m-pull-open(r1,loc3,d3,d3h)
goto(r1,loc4) closedoor(r1,d3)
unlatch throw wide end
monitor
goto(r1,loc1)
fetch(r1,o7)
… methods for other
kinds of doors
m-go-to-hallway(r1,d3,loc1)
goto(r1,lo
…
metho
for oth
kinds
routes
m2
i1
i2
m1
m3
Progressing(a(Stack(
16"Dana"Nau"and"Vikas"Shivashankar:"Lecture"slides"for!Automated!Planning!and!Ac0ng" Updated"3/24/15"
If(a(Method(Fails(
●  Similar to backtracking
!  If a method fails, try the next one
!  If none left, then fail
●  But not identical to backtracking
!  ξ may have changed
•  Because of something the actor did
•  Because the world changes dynamically
start
monitor
opendoor(r1,d3)
m-fetch(…)
take(r1,o7)
move
close to
handle
m-pull-open(r1,loc3,d3,d3h)
goto(r1,loc4) closedoor(r1,d3)
unlatch throw wide end
monitor
goto(r1,loc1)
fetch(r1,o7)
… methods for other
kinds of doors
m-go-to-hallway(r1,d3,loc1)
goto(r1,lo
…
metho
for oth
kinds
routes
m2
i1
i2
m1
m3
17"Dana"Nau"and"Vikas"Shivashankar:"Lecture"slides"for!Automated!Planning!and!Ac0ng" Updated"3/24/15"
Goals(in(RAE(
●  Special kind of task: achieve(condition)
●  Like other tasks, but includes monitoring
!  Can easily modify Progress to do this
●  Stop execution early if condition becomes true
●  fail"if condition isn’t true after execution
(triggers a Retry)
!  mHfetch(r,c)
task: fetch(r,c)
pre:
body: achieve(pos(c) ≠ unknown)
goto(pos(c))
take(r,c)
!  mHfindHwhere(r,c)
goal: achieve(pos(c) ≠ unknown)
pre:
body: while ∃l (view(l)=F) do
goto(l)
perceive(l)
●  What we had before:
mHfetch(r,c)
task: fetch(r,c)
pre:
body: if pos(c) = unknown then
search(r,c)
else if loc(r) = pos(c) then
take(r,c)
else do
goto(r,pos(c))
take(r,c)
mHsearch(r,c)
task: search(r,c)
pre: pos(c) = unknown
body: if l (view(l)=F) then
goto(r,l)
perceive(l)
if pos(c)=l then take(r,c)
else search(r,c)
else fail
18"Dana"Nau"and"Vikas"Shivashankar:"Lecture"slides"for!Automated!Planning!and!Ac0ng" Updated"3/24/15"
Extensions(to(RAE(
●  Section 3.3.4 discusses some additional features that extend RAE’s capabilities:
!  Controlling the progress of tasks, e.g., suspend a task for a while
!  Refining into concurrent subtasks
•  mHfoo(x,y,z)
task: foo(x,y,z)
pre:
body: .".".
{concurrent: ⟨ν1,1,...,ν1,n⟩⟨ν2,1,...,ν2,m⟩...⟨νk,1,...,νk,l⟩}
•  Each ⟨νi,1,...,νi,j⟩ is a sequence of steps, like the body of a method
•  Split the current stack into k sub-stacks, one for each ⟨νi,1,...,νi,j⟩
!  Choosing methods, and stack ordering
•  If there are multiple stacks, which ones get higher priority?
▸  Application-specific heuristics
•  For a task t, which method to try first?
▸  Refinement planning (Section 3.4)

More Related Content

Viewers also liked

Viewers also liked (18)

FIPH Account 2014 07 11
FIPH Account 2014 07 11FIPH Account 2014 07 11
FIPH Account 2014 07 11
 
Chapter02
Chapter02Chapter02
Chapter02
 
2.1 2.2 vitaminasclasificacion caracteristicas
2.1 2.2 vitaminasclasificacion caracteristicas2.1 2.2 vitaminasclasificacion caracteristicas
2.1 2.2 vitaminasclasificacion caracteristicas
 
spectrum-auctions
spectrum-auctionsspectrum-auctions
spectrum-auctions
 
Keukenhof
KeukenhofKeukenhof
Keukenhof
 
Chapter06
Chapter06Chapter06
Chapter06
 
Informe Pla Municipal Lesbià, Gai, Transexual i Bisexual
Informe Pla Municipal Lesbià, Gai, Transexual i Bisexual Informe Pla Municipal Lesbià, Gai, Transexual i Bisexual
Informe Pla Municipal Lesbià, Gai, Transexual i Bisexual
 
Chapter02b
Chapter02bChapter02b
Chapter02b
 
Chapter05
Chapter05Chapter05
Chapter05
 
madrid
madridmadrid
madrid
 
Chapter04
Chapter04Chapter04
Chapter04
 
Assignment
AssignmentAssignment
Assignment
 
Projeto Alfabetização online 2015
Projeto Alfabetização online 2015Projeto Alfabetização online 2015
Projeto Alfabetização online 2015
 
Overheidswebsites die werken
Overheidswebsites die werkenOverheidswebsites die werken
Overheidswebsites die werken
 
Accenture cio-2013-mobility-survey
Accenture cio-2013-mobility-surveyAccenture cio-2013-mobility-survey
Accenture cio-2013-mobility-survey
 
Conjuncions
ConjuncionsConjuncions
Conjuncions
 
013016 COMMUNITY ACTIVIST VOGEL DENISE NEWSOME (Chinese-Traditional)
013016 COMMUNITY ACTIVIST VOGEL DENISE NEWSOME (Chinese-Traditional)013016 COMMUNITY ACTIVIST VOGEL DENISE NEWSOME (Chinese-Traditional)
013016 COMMUNITY ACTIVIST VOGEL DENISE NEWSOME (Chinese-Traditional)
 
6 casamento e a bíblia
6 casamento e a bíblia6 casamento e a bíblia
6 casamento e a bíblia
 

Similar to Chapter03a

Lego: A brick system build by scala
Lego: A brick system build by scalaLego: A brick system build by scala
Lego: A brick system build by scala
lunfu zhong
 
Chapter3 Search
Chapter3 SearchChapter3 Search
Chapter3 Search
Khiem Ho
 

Similar to Chapter03a (17)

The Object Oriented Paradigm in perspective
The Object Oriented Paradigm in perspectiveThe Object Oriented Paradigm in perspective
The Object Oriented Paradigm in perspective
 
Yin Yangs of Software Development
Yin Yangs of Software DevelopmentYin Yangs of Software Development
Yin Yangs of Software Development
 
Abstract machines for great good
Abstract machines for great goodAbstract machines for great good
Abstract machines for great good
 
Clojure made really really simple
Clojure made really really simpleClojure made really really simple
Clojure made really really simple
 
Clojure made simple - Lightning talk
Clojure made simple - Lightning talkClojure made simple - Lightning talk
Clojure made simple - Lightning talk
 
10 Recursion
10 Recursion10 Recursion
10 Recursion
 
Gremlin's Graph Traversal Machinery
Gremlin's Graph Traversal MachineryGremlin's Graph Traversal Machinery
Gremlin's Graph Traversal Machinery
 
DataStax | Graph Computing with Apache TinkerPop (Marko Rodriguez) | Cassandr...
DataStax | Graph Computing with Apache TinkerPop (Marko Rodriguez) | Cassandr...DataStax | Graph Computing with Apache TinkerPop (Marko Rodriguez) | Cassandr...
DataStax | Graph Computing with Apache TinkerPop (Marko Rodriguez) | Cassandr...
 
Atmosphere 2016 - Krzysztof Kaczmarek - Don't fear the brackets - Clojure in ...
Atmosphere 2016 - Krzysztof Kaczmarek - Don't fear the brackets - Clojure in ...Atmosphere 2016 - Krzysztof Kaczmarek - Don't fear the brackets - Clojure in ...
Atmosphere 2016 - Krzysztof Kaczmarek - Don't fear the brackets - Clojure in ...
 
Prolog 01
Prolog 01Prolog 01
Prolog 01
 
Lego: A brick system build by scala
Lego: A brick system build by scalaLego: A brick system build by scala
Lego: A brick system build by scala
 
Ch7
Ch7Ch7
Ch7
 
Learning from 6,000 projects mining specifications in the large
Learning from 6,000 projects   mining specifications in the largeLearning from 6,000 projects   mining specifications in the large
Learning from 6,000 projects mining specifications in the large
 
Graph Traversal Algorithms - Depth First Search Traversal
Graph Traversal Algorithms - Depth First Search TraversalGraph Traversal Algorithms - Depth First Search Traversal
Graph Traversal Algorithms - Depth First Search Traversal
 
Class 29: Inheritance
Class 29: InheritanceClass 29: Inheritance
Class 29: Inheritance
 
Chapter3 Search
Chapter3 SearchChapter3 Search
Chapter3 Search
 
C.v.n.m (m.e. 130990119004-06)
C.v.n.m (m.e. 130990119004-06)C.v.n.m (m.e. 130990119004-06)
C.v.n.m (m.e. 130990119004-06)
 

More from Tianlu Wang

More from Tianlu Wang (20)

L7 er2
L7 er2L7 er2
L7 er2
 
L8 design1
L8 design1L8 design1
L8 design1
 
L9 design2
L9 design2L9 design2
L9 design2
 
14 pro resolution
14 pro resolution14 pro resolution
14 pro resolution
 
13 propositional calculus
13 propositional calculus13 propositional calculus
13 propositional calculus
 
12 adversal search
12 adversal search12 adversal search
12 adversal search
 
11 alternative search
11 alternative search11 alternative search
11 alternative search
 
10 2 sum
10 2 sum10 2 sum
10 2 sum
 
22 planning
22 planning22 planning
22 planning
 
21 situation calculus
21 situation calculus21 situation calculus
21 situation calculus
 
20 bayes learning
20 bayes learning20 bayes learning
20 bayes learning
 
19 uncertain evidence
19 uncertain evidence19 uncertain evidence
19 uncertain evidence
 
18 common knowledge
18 common knowledge18 common knowledge
18 common knowledge
 
17 2 expert systems
17 2 expert systems17 2 expert systems
17 2 expert systems
 
17 1 knowledge-based system
17 1 knowledge-based system17 1 knowledge-based system
17 1 knowledge-based system
 
16 2 predicate resolution
16 2 predicate resolution16 2 predicate resolution
16 2 predicate resolution
 
16 1 predicate resolution
16 1 predicate resolution16 1 predicate resolution
16 1 predicate resolution
 
15 predicate
15 predicate15 predicate
15 predicate
 
09 heuristic search
09 heuristic search09 heuristic search
09 heuristic search
 
08 uninformed search
08 uninformed search08 uninformed search
08 uninformed search
 

Chapter03a