1. 1
Dana
Nau
and
Vikas
Shivashankar:
Lecture
slides
for
Automated
Planning
and
Ac0ng
Updated
4/9/15
This
work
is
licensed
under
a
CreaBve
Commons
AEribuBon-‐NonCommercial-‐ShareAlike
4.0
InternaBonal
License.
Chapter
4
Delibera.on
with
Temporal
Domain
Models
Dana S. Nau and Vikas Shivashankar
University of Maryland
2. 2
Dana
Nau
and
Vikas
Shivashankar:
Lecture
slides
for
Automated
Planning
and
Ac0ng
Updated
4/9/15
Temporal
Planning
time
statevariables
state
timeline
● Motivation: changes don’t occur instantaneously
Ø Actions take time, may overlap
Ø Need ways to reason about this
● Up to now, we’ve used a “state-oriented view”
• Sequence of states s0, s1, s2
• Actions that transform each state into the next one
Ø No way to reason about overlapping actions
● Switch to a “time-oriented view”
Ø Sequence of time points
• t = 1, 2, 3, …
Ø For each state variable x,
different values during
different time intervals
Ø At each time t, the state is
the set of atoms that are
true at time t
3. 3
Dana
Nau
and
Vikas
Shivashankar:
Lecture
slides
for
Automated
Planning
and
Ac0ng
Updated
4/9/15
time
loc(r1)
loc1
loc2
l
t1 t2 t3 t4
Change
Persistence
Temporal
Asser.ons
and
Constraints
● Temporal assertion:
Ø a state variable’s value
during a time interval
● Examples:
change: [t1,t2] loc(r1):(loc1, l) during [t1,t2], loc(r1)
changes from loc1
to l
persistence: [t2,t3] loc(r1)=l during [t2,t3], loc(r1)
= l
change: [t3,t4] loc(r1):(l, loc2) during [t3,t4], loc(r1)
changes from l to loc1
● These assertions entail the following temporal constraints
Ø t1 < t2 < t3 < t4
● They also entail the following object constraints
Ø l ≠ loc1, l ≠ loc2
● We may want to specify additional constraints that aren’t entailed
4. 4
Dana
Nau
and
Vikas
Shivashankar:
Lecture
slides
for
Automated
Planning
and
Ac0ng
Updated
4/9/15
Timelines
time
loc(r1)
loc1
loc2
l
t1 t2 t3 t4
Change
Persistence
● Timeline: a pair (T,C )
Ø T is a set of temporal
assertions for the
same state variable
Ø C is a set of constraints
● T = {[t1,t2] loc(r1):(loc1,l), [t2,t3] loc(r1)=l, [t3,t4] loc(r1):(l,loc2)}
● C = (t1 < t2 < t3 < t4, l ≠ loc1, l ≠ loc2)
Ø written with parentheses rather than set braces
● If a constraint is entailed by T then there’s no need to have it in C too
Ø In the above example, (T,C ) is equivalent to (T, ∅)
5. 5
Dana
Nau
and
Vikas
Shivashankar:
Lecture
slides
for
Automated
Planning
and
Ac0ng
Updated
4/9/15
Timelines
● [t1,t2] loc(r1):(loc1,l)
• sometime during [t1,t2], r1
leaves loc1
• sometime during [t1,t2], r1
arrives at l
Ø But the expression doesn’t say exactly when
● If we want to be more specific, we could add these to T
• [t1,t1+1] loc(r1):(loc1,route)
• [t2–1,t2] loc(r1):(route,l)
Ø Each change requires at least one unit of time
time
loc(r1)
loc1
loc2
l
t1 t2 t3 t4
Change
Persistence
6. 6
Dana
Nau
and
Vikas
Shivashankar:
Lecture
slides
for
Automated
Planning
and
Ac0ng
Updated
4/9/15
Separa.on
Constraints
● A set of assertions T is nonconflicting if it’s consistent for all variable assignments
Ø e.g., T1 = {[t1,t2] loc(r1)=loc1, [t2,t3] loc(r1):(loc1,
loc2)}
● Otherwise T is potentially conflicting
Ø e.g., T2 = {[t1,t2] loc(r1)=loc1, [t3,t4] loc(r1):(l,lʹ)}
• e.g., it would be inconsistent if t1 < t3 < t2 and l ≠ loc1
● Separation constraint: a set of constraints that prevents the conflict
Ø Some possible separation constraints for C2:
Ø (t2 < t3), (t4 < t1), (t2 ≤ t3, l=loc1), (t4 ≤ t1, l′=loc1)
● (T,C) is secure if T is nonconflicting, or C entails a separation constraint for T
• e.g., (T1, ∅) or (T2, (t2 < t3))
● (T,C) is viable if either T is nonconflicting, or there exists a separation constraint
Cʹ for T that is consistent with C
• (T1, ∅) nonconflicting
• (T2, ∅) Cʹ = (t2 < t3)
Ø If (T,C) is viable and Cʹ is as in the definition, then (T,C ∪ Cʹ) is secure
7. 7
Dana
Nau
and
Vikas
Shivashankar:
Lecture
slides
for
Automated
Planning
and
Ac0ng
Updated
4/9/15
Causal
Support
● In a timeline (T,C), let α be one of the following:
Ø a persistence assertion, e.g., [t,t′] x=v
Ø a change assertion, e.g., [t,t′] x:(v,v′)
● α is causally supported if T contains another temporal assertion that establishes
x=v at time t
Ø Causal support could have one of the following forms:
a persistence assertion [t′′,t] x=v
a change assertion [t′′,t] x:(v′′,v)
8. 8
Dana
Nau
and
Vikas
Shivashankar:
Lecture
slides
for
Automated
Planning
and
Ac0ng
Updated
4/9/15
Causal
Support
● Example
T = {[t1,t2] loc(r1):(loc1,l),
[t2,t3] loc(r1)=l,
[t3,t4] loc(r1):(l,loc2)}
C = (t4 < t5, l ≠ loc1, l ≠ loc2)
Ø [t2,t3] loc(r1)=l is causally supported by [t1,t2] loc(r1):(loc1,l)
Ø [t3,t4] loc(r1):(l,loc2) is causally supported by [t2,t3] loc(r1)=l
Ø [t1,t2] loc(r1):(loc1,l) isn’t causally supported
time
loc(r1)
loc1
loc2
l
t1 t2 t3 t4
Change
Persistence
9. 9
Dana
Nau
and
Vikas
Shivashankar:
Lecture
slides
for
Automated
Planning
and
Ac0ng
Updated
4/9/15
Temporal
Model
of
an
Ac.on
● Each action is represented by a triple (head,T,C), where
Ø head is the name and arguments
Ø T is a set of temporal assertions about one or more state variables
• i.e., T is the union of one or more timelines
Ø T is a set of constraints
● On the next two slides, an example
10. 10
Dana
Nau
and
Vikas
Shivashankar:
Lecture
slides
for
Automated
Planning
and
Ac0ng
Updated
4/9/15
Objects,
Rigid
Rela.ons,
State
Variables
● Robots moving among loading docks connected by a network of roads
● Objects and ranges of variables:
Ø r ∈ Robots, k ∈ Cranes, c ∈ Containers, p ∈ Piles, d ∈ Docks, w ∈ Roads
● Rigid relations:
Ø aEached ⊆ (Cranes ∪ Piles) × Docks
Ø adjacent ⊆ Docks × Roads
● State variables:
Ø loc(r) ∈ Docks ∪ Roads
Ø cargo(r) ∈ Containers ∪ {nil}
Ø pos(c) ∈ Containers ∪ Robots ∪ Cranes
Ø pile(c) ∈ Piles ∪ {nil}
Ø grip(k) ∈ Containers ∪ {nil}
Ø top(p) ∈ Containers
∪ {pallet}
Ø content(d) ∈ Robots ∪ {nil}
d1
r1
d2
r2
w1
11. 11
Dana
Nau
and
Vikas
Shivashankar:
Lecture
slides
for
Automated
Planning
and
Ac0ng
Updated
4/9/15
d1
Ac.ons
leave(r,d,w): robot r leaves dock d to an adjacent road w
enter(r,d,w): r enters d from an adjacent road w
navigate(w,w′): navigate from road w to w′
pickup(k,c,r): crane k picks up container c from robot r
putdown(k,c,r): crane k puts down container c on r
stack(k,c,p): crane k stacks container c on top of pile p
unstack(k,c,p): crane k takes a container c from top of p
● Examples:
leave(r,d,w)
[ts,t] loc(r): (d,w)
[t,te] content(d): (r,nil)
t ≤ ts + δ
adjacent(d,w)
● No separate “preconditions” and “effects”
Ø The precondition is to establish causal support
pickup(k,c,r)
[ts,t] grip(k): (nil, c)
[ts,t] pos(c): (r,k)
[ts,t] cargo(r): (c,nil)
[ts,te] loc(r) = d
t ≤ ts + δ, t ≤ te
aEached(k,d)
r1
d2
r2
w1
c1
What’s
wrong
with
this
drawing?
w2
12. 12
Dana
Nau
and
Vikas
Shivashankar:
Lecture
slides
for
Automated
Planning
and
Ac0ng
Updated
4/9/15
Chronicle
● Chronicle: a triple φ = (A,T,C)
Ø A is a set of temporally qualified actions and tasks
Ø T is a set of temporally qualified assertions for a set of state variables
Ø C is a consistent set of constraints on the variables in A and T
● The following definitions all generalize to chronicles
Ø Potentially conflicting assertions
Ø Separation constraints
Ø Secure and viable timelines
Ø Causal support
13. 13
Dana
Nau
and
Vikas
Shivashankar:
Lecture
slides
for
Automated
Planning
and
Ac0ng
Updated
4/9/15
Example
● φ = (A,T,C) , where
● A = {[t0,t1] leave(r1,dock1,w1),
[t1,t2] navigate(r1,w1,w2),
[t2,t3] enter(r1,dock2,w2),
[t′0,t′1] leave(r2,dock2,w2),
[t′1,t′2] navigate(r2,w2,w1),
[t′2, t′3] enter(r2,dock1,w1)}
● T = {temporal assertions for the
above actions}
● C = (t′1 < t2, t1 < t′2,
adjacent(dock1,w1),
adjacent(dock2,w2))
time
r1
leave
dock1
t1 t2 t3t0
navigate enter
dock2
r2
leave
dock2
t’1 t’2 t’3t’0
navigate
enter
dock1
dock1
r1
dock2
r2
w1
w2
14. 14
Dana
Nau
and
Vikas
Shivashankar:
Lecture
slides
for
Automated
Planning
and
Ac0ng
Updated
4/9/15
Another
Example
● φ = (∅, {[0,1] loc(r1)=dock1,
[0,1] loc(r2)=dock2,
[5,t] docked(ship1)=pier1,
[10,t′] docked(ship2)=pier2)},
(t ≥ 5 + δ, t′ ≥ 10 + δ′))
● No actions this time
Ø Just temporal assertions and constraints
● Represents a situation where various exogenous events are scheduled to occur
15. 15
Dana
Nau
and
Vikas
Shivashankar:
Lecture
slides
for
Automated
Planning
and
Ac0ng
Updated
4/9/15
move
t1
t2
t3
ts
uncover
pile(c)=p’
cargo(r)=nil
load
move
unload
t4 t6t5 t7 te
Temporal
Tasks
and
Refinement
Methods
● A task is an expression of the form [t,t′] taskname(arg1,arg2,…)
Ø the task starts at or after t, and ends at or before t′
● A method is a triple (head, task, body)
Ø Will normally write it as in the following example
● Method for bringing a container c to a pile p
● m-‐bring(c,p,p′,d,d′,r)
task: bring(c,p)
body:
[ts,t1] pile(c) = p′
[ts,t1] cargo(r) = nil
[ts,t2] move(r,d′)
[ts,t3] uncover(c)
[t1,t4] load(c,r)
[t5,t6] move(r,d)
[t7,te] unload(r,p)
aEached(p′,d′), aEached(p,d), d ≠ d′
t2 ≤ t1, t3 ≤ t1, t3 ≤ t5, t6 ≤ t7
16. 16
Dana
Nau
and
Vikas
Shivashankar:
Lecture
slides
for
Automated
Planning
and
Ac0ng
Updated
4/9/15
More
Refinement
Methods
● A second uncover method is needed, for the case where c = top(p)
17. 17
Dana
Nau
and
Vikas
Shivashankar:
Lecture
slides
for
Automated
Planning
and
Ac0ng
Updated
4/9/15
Temporal
Planning
Domains/Problems
● Planning domain:
Ø Objects, rigid relations, state variables, primitive actions, temporal
refinement methods
● Planning problem:
Ø A pair (Σ,φ0)
• Σ is a temporal planning domain
• φ0 is an initial chronicle
● φ0 = () includes
Ø initial state of the world
Ø future facts that are expected to occur independently of the activities to
be planned for
Ø the tasks to be performed
● All assertions in φ0 must be non-conflicting
18. 18
Dana
Nau
and
Vikas
Shivashankar:
Lecture
slides
for
Automated
Planning
and
Ac0ng
Updated
4/9/15
Solu.ons
to
Temporal
Planning
Problems
● Solution plan: a chronicle φ = (A,T,C) having the following properties
Ø (i) φ contains no tasks. It contains actions and the corresponding assertions
produced
• These refine all tasks in φ0, all tasks produced by refining those tasks, and
so forth, all the way down
▸ as in the definition of a solution to a refinement planning problem
Ø (ii) All assertions in φ except for those in φ0 must be causally supported
Ø (iii) φ is secure
● Planning is done by a combination of refinement and flaw repair
Ø three types of flaws
• φ has tasks: violates condition (i)
• φ has non-supported assertions: violates condition (ii)
• φ has potentially conflicting assertions: violates condition (iii)
19. 19
Dana
Nau
and
Vikas
Shivashankar:
Lecture
slides
for
Automated
Planning
and
Ac0ng
Updated
4/9/15
Planning
Algorithm
● Very similar to PSP in Chapter 2
Ø Both repeatedly select flaws and
choose resolvers
Ø One uses a loop, the other uses
recursion
• Just programming style,
can be rewritten either way
• Which do you think is clearer?
● In a deterministic implementation
Ø resolver selection is a
backtracking point
Ø flaw selection isn’t
20. 20
Dana
Nau
and
Vikas
Shivashankar:
Lecture
slides
for
Automated
Planning
and
Ac0ng
Updated
4/9/15
Resolvers
for
Flaws
● First kind of flaw: φ contains a task
Ø Resolver: any applicable instance m of a refinement method
• applicable if it matches the task and its constraints are consistent with φ’s
Ø Applying the resolver:
• Modify φ by replacing the task with m
● Second kind: φ contains a temporal assertion α that isn’t causally supported (like
an open goal in PSP)
Ø Resolvers:
• Add constraints to C
• Add a persistence assertion to T
• Add a new task or action to A that supports α
● Third kind: φ contains assertions that potentially conflict (like threats in PSP)
Ø These weren’t in φ0
• Must have been introduced by a resolver for another flaw
Ø Resolvers: separation constraints
21. 21
Dana
Nau
and
Vikas
Shivashankar:
Lecture
slides
for
Automated
Planning
and
Ac0ng
Updated
4/9/15
Example
● leave(r,d,w)
[ts,t] loc(r): (d,w)
[t,te] occupant(d): (r,nil)
adjacent(d,w)
● enter(r,d,w)
[ts,t] occupant(d): (nil,r)
[t,te] loc(r): (w,d)
adjacent(d,w)
● m-‐move(r,d1,d2,w)
task: move(r,d2)
body: [ts,t1] loc(r) = d1
[t1,t2] leave(r,d,w)
[t3,te] enter(r,d,w)
adjacent(d1,w)
adjacent(d2,w)
d1≠d2
t2 < t3
d1
r1
d2
r2
w1
● φ0 = (∅,
{[t0,t1] loc(r1)=d1,
[t0,t1] occupant(d1)=r1,
[t1,t2] move(r1,d1,d2,w1),
[t′0,t′1] loc(r2)=d2,
[t′0,t′1] occupant(d2)=r2,
[t′1,t′2]
move(r2,d2,d1,w1)},
(adjacent(d1,w1), adjacent(d2,w1),
t1 < t′2, t′1 < t2))
● Like earlier example, but simplified by removing navigation
22. 22
Dana
Nau
and
Vikas
Shivashankar:
Lecture
slides
for
Automated
Planning
and
Ac0ng
Updated
4/9/15
NOTE
● I told Malik about the problem with TemPlan never putting the action
specifications into φ. He agrees it’s a problem, and he’ll fix it.
23. 23
Dana
Nau
and
Vikas
Shivashankar:
Lecture
slides
for
Automated
Planning
and
Ac0ng
Updated
4/9/15
Heuris.cs
for
guiding
TemPlan
● Flaw selection, resolver selection
heuristics similar to those in PSP
Ø Select the flaw with the smallest
number of resolvers
Ø Choose the resolver that rules out
the fewest resolvers for the other
flaws
● There is also a problem with
constraint management
Ø We ignored it when discussing
PSP
Ø We’ll discuss it now
24. 24
Dana
Nau
and
Vikas
Shivashankar:
Lecture
slides
for
Automated
Planning
and
Ac0ng
Updated
4/9/15
Constraint
Management
● Each time TemPlan
applies a resolver, it modifies (T,C)
Ø Some resolvers will make (T,C) inconsistent
▸ No solution in this part of the search space
• Detect inconsistency => prune this part of the search space
• Don’t detect it => waste time looking for a solution
● Analogy: PSP checked simple cases of inconsistency
Ø E.g., can’t create a constraint a ≺ b if there’s already a constraint b ≺ a
Ø But PSP ignored more complicated cases
● Example:
Ø Containers = {c1, c2}
Ø Range(c1) = Range(c2) = Range(c3) = Containers
Ø Suppose that to resolve 3 threats,
PSP chooses these resolvers:
• c1 ≠ c2, c2 ≠ c3, c1 ≠ c3
Ø No solutions in this part of the search
space, but PSP searches it anyway …
… …
…
…
…
…
…
…
…
…
… …
…
… …
……… …… … … … … … … …
25. 25
Dana
Nau
and
Vikas
Shivashankar:
Lecture
slides
for
Automated
Planning
and
Ac0ng
Updated
4/9/15
Constraint
Management
in
TemPlan
● At various points, check consistency of C
Ø If C is inconsistent, then (T,C) is inconsistent
• Can prune this part of the search space
Ø If C is consistent then (T,C) may or may not be consistent
● Example of a case where C is consistent but (T,C) isn’t:
• T = {[t1, t2] loc(r1)=loc1, [t3, t4] loc(r1)=loc2}
• C = (t1 < t3 < t4 < t2)
26. 26
Dana
Nau
and
Vikas
Shivashankar:
Lecture
slides
for
Automated
Planning
and
Ac0ng
Updated
4/9/15
Consistency
of
C
● C contains two kinds of constraints
Ø Temporal constraints
• t1 < t3
Ø Object constraints
• loc(r) ≠ l2
● The way we’ve formulated them, they are decoupled
Ø no constraint involves both objects and time points
● Two separate subproblems
Ø check consistency of object constraints
Ø check consistency of temporal constraints
Ø C is consistent iff both are consistent
27. 27
Dana
Nau
and
Vikas
Shivashankar:
Lecture
slides
for
Automated
Planning
and
Ac0ng
Updated
4/9/15
Object
Constraints
● Constraint-satisfaction problem (CSP)
Ø Checking consistency of CSPs is NP-hard
● Can write an algorithm that’s complete but runs in exponential time
• If there’s an inconsistency, always finds it
• Might prune large parts of the search space
• But may spend lots of time at each node visited
● Some well-known constraint-satisfaction techniques
that are incomplete but run in polynomial time
• arc consistency, path consistency
Ø Detect some inconsistencies but not others
Ø Might not prune as much of the search space
Ø But less time at each node
…
… …
…
…
…
…
…
…
…
…
… …
…
… …
……… …… … … … … … … …
28. 28
Dana
Nau
and
Vikas
Shivashankar:
Lecture
slides
for
Automated
Planning
and
Ac0ng
Updated
4/9/15
Time
Constraints
● Can check of time constraints in time O(n3)
● Simple Temporal Network (STN): a pair (τ,φ), where
• τ = {a set of temporal variables t1, …, tn}
• φ is a set of expressions that represent constraints on the variables in τ
Ø Called a network because these correspond to nodes and edges in a graph
● Each expression in φ has the form rij = [aij,bij], where aij and bij are integers
Ø Denotes a binary constraint aij ≤ tj − ti ≤ bij
Ø Thus rij = [aij,bij] is equivalent to rji = [–b,–a]
● To represent unary constraints, include a dummy variable t0 = 0
Ø r0i = [a0i,b0i] represents a0i ≤ ti − t0 ≤ b0i
• i.e., a0i ≤ ti ≤ b0i
● Solution to an STN: an integer value for each ti
Ø An STN is consistent if it has a solution
Ø An STN is minimal if for every constraint rij,
every pair (ti, tj) that satisfies rij belongs to at least one solution
ti
tj
[aij,bij]
t0
[a0i,b0i]
29. 29
Dana
Nau
and
Vikas
Shivashankar:
Lecture
slides
for
Automated
Planning
and
Ac0ng
Updated
4/9/15
Two
Examples
● STN (τ,φ), where
Ø τ = {t1, t2, t3}
Ø φ = {r12=[1,2], r23=[3,4], r13=[2,3]}
● Transitivity:
Ø 1 ≤ t2 – t1 ≤ 2
Ø 3 ≤ t3 – t2 ≤ 4
==> 4 ≤ t3 – t1 ≤ 6
● r′13 = [4,6]
● Can’t satisfy both r13 and r′13
Ø r13 ∩ r′13 = [2,3] ∩ [4,6] = ∅
● (τ,φ) is inconsistent
● STN (τ,φ), where
Ø τ = {t1, t2, t3}
Ø φ = {r12=[1,2], r23=[3,4], r13=[2,5]}
● As before, r′13 = [4,6]
● This time, (τ,φ) is consistent
Ø r13 ∩ r′13 = [4,5]
● Change r13 to [4,5]
Ø Minimal network:
t1
t2
t3
[1,2]
[3,4]
[2,3]
t1
t2
t3
[1,2]
[3,4]
[2,5]
t1
t2
t3
[1,2]
[3,4]
[4,5]
30. 30
Dana
Nau
and
Vikas
Shivashankar:
Lecture
slides
for
Automated
Planning
and
Ac0ng
Updated
4/9/15
Opera.ons
on
STNs
● Suppose rik = [aik,bik], rkj = [akj,bkj], rij = [aij,bij]
Ø Composition:
• rik • rkj = [aik +akj, bik +bkj]
Ø Intersection:
• rij ∩ r′ij = [max(aij +a′ij), min(bij +b′ij)]
Ø Consistency checking:
• rik , rkj , rij are consistent if rij ∩ (rik • rkj) ≠ ∅
● PC (Path Consistency) algorithm:
Ø Do the above computations
on all triples of constraints
Ø In cases where the constraint
doesn’t exist, use [−∞, +∞]
Ø n constraints => n3 triples
=> running time O(n3)
PC(τ,φ)
for k = 1 to n do
for every i ∈ {1,…, n–1} such that i ≠ k do
for every j ∈ {i+1, …, n} such that j ≠ k do
rij ← rij ∩ [rik • rkj]
if rij = ∅ then return inconsistent
ti
tk
tj
[aik,bik]
[akj,bkj]
[aij,bij]
31. 31
Dana
Nau
and
Vikas
Shivashankar:
Lecture
slides
for
Automated
Planning
and
Ac0ng
Updated
4/9/15
Example
t2
[1, 2]
[1, 2]
t1 t4
t3
t5
[3, 4]
[6, 7]
[4, 5]
● For k = 2, PC adds a constraint r14 = [4,6]
Ø Additional iterations …
● What PC is supposed to accomplish
Ø Make the STN minimal
• Shrink each time interval rik to exclude
values that aren’t part of any solution
Ø Detect inconsistent networks
• If rik = [aik,bik] is empty (i.e., bik < aik), then inconsistent
● PC
is supposed to be complete, but I’m not convinced that it is
PC(τ,φ)
for k = 1 to n do
for every i ∈ {1,…, n–1} such that i ≠ k do
for every j ∈ {i+1, …, n} such that j ≠ k do
rij ← rij ∩ [rik • rkj]
if rij = ∅ then return inconsistent
ti
tk
tj
[aik,bik]
[akj,bkj]
[aij,bij]
32. 32
Dana
Nau
and
Vikas
Shivashankar:
Lecture
slides
for
Automated
Planning
and
Ac0ng
Updated
4/9/15
Example
● Can modify PC to make it incremental
Ø Input: a consistent, minimal STN, and
a new constraint r′ij
Ø Incorporate r′ij in time O(n2)
PC(τ,φ)
for k = 1 to n do
for every i ∈ {1,…, n–1} such that i ≠ k do
for every j ∈ {i+1, …, n} such that j ≠ k do
rij ← rij ∩ [rik • rkj]
if rij = ∅ then return inconsistent
33. 33
Dana
Nau
and
Vikas
Shivashankar:
Lecture
slides
for
Automated
Planning
and
Ac0ng
Updated
4/9/15
Controllability
● Suppose TemPlan gives you a chronicle and you want to execute it
Ø Constraints on time points
Ø Need to reason about these in order to decide when to start each action
● Section 4.4.3 is about this
Ø Uses STNs, but doesn’t explain how you would get them from chronicles
• I need to discuss this with Malik
Ø I’ll just assume we have the STNs, and proceed from there
34. 34
Dana
Nau
and
Vikas
Shivashankar:
Lecture
slides
for
Automated
Planning
and
Ac0ng
Updated
4/9/15
Controllability
● Example:
Ø bring&move to be done by a robot, takes 30 to 50 time units
Ø uncover to be done by a crane, takes 5 to 10 time units
● Want at most 5 seconds between the two ending times
Ø Don’t want either the crane or robot to wait long
● Can we accomplish this?
● Run PC, get a minimized network
Ø Network is consistent
Ø There exists a set of time points that satisfies all the constraints
● That assumes we can control each action’s starting time and ending time
Ø But we can’t always do that
● Suppose the time durations are nondeterministic
● Then t1 is controllable and t2 is uncontrollable
Ø We can choose the value of t1
Ø We know t2 ∈ [t1+30, t1+50], but we can’t choose which value
t1
t3
t2
t4
[30, 50]
[5, 10]
[-5,5]
bring&move
uncover
t1
t3
t2
t4
[30, 50]
[5, 10]
[-5,5]
[15,50]
[0,15]
[25,55]
35. 35
Dana
Nau
and
Vikas
Shivashankar:
Lecture
slides
for
Automated
Planning
and
Ac0ng
Updated
4/9/15
STNUs
● STNU (Simple Temporal Network with Uncertainty):
Ø A 4-tuple (τ,E,φ,C)
• τ and E are disjoint sets of time points
• φ and C are disjoint sets of binary constraints on time points
• τ and φ are controllable (e.g., actions’ starting times
• E and C are contingent (e.g., actions’ ending times)
● Consider an action that has a controllable starting time ts ∈ τ and a contingent
ending time te ∈ E
● Suppose C contains a constraint [l,u] on ts and te
Ø Then te – ts will be somewhere in [l, u], but we don’t know where
• Like a random variable from an unknown distribution
● Want to ensure that there exists a combination of values for the variables in τ
such that for every combination of values of the variables in E,
if C is satisfied then φ is satisfied
36. 36
Dana
Nau
and
Vikas
Shivashankar:
Lecture
slides
for
Automated
Planning
and
Ac0ng
Updated
4/9/15
Dynamic
Execu.on
Strategies
● Dynamic execution strategy: procedure that assigns values to controllable time
points, in real time
Ø E.g., if these are the starting times of actions, the strategy selects actions
one at a time, and starts executing them
● Conditions under which the strategy operates (I think)
(1) Can’t ever assign a value that’s in the past
• Suppose the strategy selects a time point t ∈ τ and gives it a value v
• Then v ≥ the current time
(2) For each contingent time point t ∈ C
• the strategy won’t learn t’s value until t is the current time
● (to be continued)