© Martha E. Pollack Planning and Execution Martha E. Pollack University of Michigan www.eecs.umich.edu/~pollackm PLANET International Summer School On.

Slides:



Advertisements
Similar presentations
Constraint Satisfaction Problems
Advertisements

Foundations of Constraint Processing Temporal Constraints Networks 1Topic Foundations of Constraint Processing CSCE421/821, Spring
Planning Module THREE: Planning, Production Systems,Expert Systems, Uncertainty Dr M M Awais.
CLASSICAL PLANNING What is planning ?  Planning is an AI approach to control  It is deliberation about actions  Key ideas  We have a model of the.
1 Constraint Satisfaction Problems A Quick Overview (based on AIMA book slides)
1 Finite Constraint Domains. 2 u Constraint satisfaction problems (CSP) u A backtracking solver u Node and arc consistency u Bounds consistency u Generalized.
ICS-271:Notes 5: 1 Lecture 5: Constraint Satisfaction Problems ICS 271 Fall 2008.
MBD and CSP Meir Kalech Partially based on slides of Jia You and Brian Williams.
Optimal Rectangle Packing: A Meta-CSP Approach Chris Reeson Advanced Constraint Processing Fall 2009 By Michael D. Moffitt and Martha E. Pollack, AAAI.
Probabilistic Planning Jim Blythe November 6th. 2 CS 541 Probabilistic planning A slide from August 30th: Assumptions (until October..) Atomic time All.
Technology to Support Individuals with Cognitive Impairment Martha E. Pollack Computer Science & Engineering University of Michigan.
Review: Constraint Satisfaction Problems How is a CSP defined? How do we solve CSPs?
Planning and Scheduling. 2 USC INFORMATION SCIENCES INSTITUTE Some background Many planning problems have a time-dependent component –  actions happen.
Best-First Search: Agendas
1 Chapter 16 Planning Methods. 2 Chapter 16 Contents (1) l STRIPS l STRIPS Implementation l Partial Order Planning l The Principle of Least Commitment.
Planning under Uncertainty
CPSC 322, Lecture 9Slide 1 Search: Advanced Topics Computer Science cpsc322, Lecture 9 (Textbook Chpt 3.6) January, 23, 2009.
CPSC 322, Lecture 19Slide 1 Propositional Logic Intro, Syntax Computer Science cpsc322, Lecture 19 (Textbook Chpt ) February, 23, 2009.
Constraint Logic Programming Ryan Kinworthy. Overview Introduction Logic Programming LP as a constraint programming language Constraint Logic Programming.
Reinforcement Learning
An Approximation of Generalized Arc-Consistency for Temporal CSPs Lin Xu and Berthe Y. Choueiry Constraint Systems Laboratory Department of Computer Science.
Ryan Kinworthy 2/26/20031 Chapter 7- Local Search part 1 Ryan Kinworthy CSCE Advanced Constraint Processing.
Constraint Satisfaction Problems
4/25/08Prof. Hilfinger CS164 Lecture 371 Global Optimization Lecture 37 (From notes by R. Bodik & G. Necula)
A New Efficient Algorithm for Solving the Simple Temporal Problem Lin Xu & Berthe Y. Choueiry Constraint Systems Laboratory University of Nebraska-Lincoln.
Jean-Charles REGIN Michel RUEHER ILOG Sophia Antipolis Université de Nice – Sophia Antipolis A global constraint combining.
BNAIC, Oct, Temporal Plans and Resource Management Pieter Buzing & Cees Witteveen TU Delft.
Chapter 5 Outline Formal definition of CSP CSP Examples
4/18/2005EE5621 EE562 ARTIFICIAL INTELLIGENCE FOR ENGINEERS Lecture 7, 4/25/2005 University of Washington, Department of Electrical Engineering Spring.
Penn ESE535 Spring DeHon 1 ESE535: Electronic Design Automation Day 15: March 18, 2009 Static Timing Analysis and Multi-Level Speedup.
Lecture 12 Synchronization. EECE 411: Design of Distributed Software Applications Summary so far … A distributed system is: a collection of independent.
Consistency Methods for Temporal Reasoning Lin XU Constraint Systems Laboratory Advisor: Dr. B.Y. Choueiry April, 2003 Supported by a grant from NASA-Nebraska,
Prof. Bodik CS 164 Lecture 16, Fall Global Optimization Lecture 16.
Constraint Satisfaction Problems
Distributed Constraint Optimization Michal Jakob Agent Technology Center, Dept. of Computer Science and Engineering, FEE, Czech Technical University A4M33MAS.
CP Summer School Modelling for Constraint Programming Barbara Smith 1.Definitions, Viewpoints, Constraints 2.Implied Constraints, Optimization,
Homework 1 ( Written Portion )  Max : 75  Min : 38  Avg : 57.6  Median : 58 (77%)
Chapter 9: Rules and Expert Systems Lora Streeter.
CP Summer School Modelling for Constraint Programming Barbara Smith 2. Implied Constraints, Optimization, Dominance Rules.
Constraint Satisfaction CPSC 386 Artificial Intelligence Ellen Walker Hiram College.
CSCI 5582 Fall 2006 CSCI 5582 Artificial Intelligence Fall 2006 Jim Martin.
1 Chapter 16 Planning Methods. 2 Chapter 16 Contents (1) l STRIPS l STRIPS Implementation l Partial Order Planning l The Principle of Least Commitment.
Chapter 5 Constraint Satisfaction Problems
AI Lecture 17 Planning Noémie Elhadad (substituting for Prof. McKeown)
Review Test1. Robotics & Future Technology Future of Intelligent Systems / Ray Kurzweil futurist Ray Kurzweil / A Long Bet A Long Bet / Robot Soccer.
Chapter 2) CSP solving-An overview Overview of CSP solving techniques: problem reduction, search and solution synthesis Analyses of the characteristics.
Constraint Satisfaction Problems (Chapter 6)
Problem Reduction So far we have considered search strategies for OR graph. In OR graph, several arcs indicate a variety of ways in which the original.
Arc Consistency CPSC 322 – CSP 3 Textbook § 4.5 February 2, 2011.
Making Path-Consistency Stronger for SAT Pavel Surynek Faculty of Mathematics and Physics Charles University in Prague Czech Republic.
1 Constraint Satisfaction Problems: Formulation, Arc Consistency & Propagation 1 Brian C. Williams October 13 th, 2004 Slides adapted from:
Chapter 5 Team Teaching AI (created by Dewi Liliana) PTIIK Constraint Satisfaction Problems.
Spring Routing: Part I Section 4.2 Outline Algorithms Scalability.
1 CSC 384 Lecture Slides (c) , C. Boutilier and P. Poupart CSC384: Lecture 16  Last time Searching a Graphplan for a plan, and relaxed plan heuristics.
The minimum cost flow problem. Solving the minimum cost flow problem.
A Structural Characterization of Temporal Dynamic Controllability Paul Morris NASA Ames Research Center Moffett Field, CA 94035, U.S.A.
Tuesday, March 19 The Network Simplex Method for Solving the Minimum Cost Flow Problem Handouts: Lecture Notes Warning: there is a lot to the network.
Temporal Plan Execution: Dynamic Scheduling and Simple Temporal Networks Brian C. Williams J/6.834J December 2nd,
CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12
CS 4700: Foundations of Artificial Intelligence
Consistency Methods for Temporal Reasoning
CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12
The minimum cost flow problem
Constraint Satisfaction Problems Lecture # 14, 15 & 16
CS137: Electronic Design Automation
CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12
Temporal Planning, Scheduling and Execution
Constraint Graph Binary CSPs
Consistency algorithms
CS137: Electronic Design Automation
Presentation transcript:

© Martha E. Pollack Planning and Execution Martha E. Pollack University of Michigan PLANET International Summer School On AI Planning 2002

© Martha E. Pollack Classical Planning Goal on(a,b)  on(b,c) Actions pickup(X) put(Y,Z) Initial Conditions on(a,b)  on(b,table)  on(c,table) PLANNER Plan EXECUTION Behavior

© Martha E. Pollack Classical Planning Assumptions World is static (and therefore single agent). Actions are deterministic. Planning agent is omniscient. All goals are known at the outset. Consequently, everything will “go as planned”: execution is a trivial matter.

© Martha E. Pollack Planning in “Real Life” Triage in the hospital emergency room Initial State(s): Sick or injured patients Goal State(s): Each patient treated appropriately Actions: Perform medical tests, administer medication, suture wounds, apply casts to broken bones, send to surgery...

© Martha E. Pollack Typical Plan (Protocol) US NINDS Guidelines for Treatment of Potential Stroke (Thrombolytic) Patient ACTIONTIME TARGET Hospital door to doctor10 minutes Door to neurological expert15 minutes Door to CT scan completion25 minutes Door to CT scan interpretation45 minutes Depending on test results, door to treatment 60 minutes Depending on test results, admission to monitored bed 3 hours

© Martha E. Pollack Problem Characteristics World is dynamic and multi-agent –E.g., many doctors and nurses Actions are not deterministic –E.g., patients respond differently to the same treatment Planning and executing agents are not omniscient –E.g., physicians don’t know each patient’s medical history Planning “problems” (i.e., patients) arrive asynchronously  Planning and Execution need to be interleaved and actively managed Skeletal plans (protocols) are known in advance

© Martha E. Pollack Integrated Model of Planning and Execution PLANNER(S) Commitments (Partially Elaborated Plans) And Reservations GOALSGOALS World State Actions and Skeletal Plans EXECUTIVE(S) Behavior

© Martha E. Pollack Domains AI systems for planning and execution have been developed for –Automated spacecraft –Mobile robot applications –Military campaign management –Air traffic control –Cognitive orthotics – and many more applications

© Martha E. Pollack Outline Lecture #1: Execution Lecture #2: Planning and Execution

© Martha E. Pollack Integrated Model of Planning and Execution PLANNER(S) Commitments (Partially Elaborated Plans) And Reservations GOALSGOALS World State Actions and Skeletal Plans EXECUTIVE(S) Behavior The Dispatch Problem

© Martha E. Pollack Today’s Outline 1.Introduction 2.Satisfying Temporal Constraints during Execution A.Temporal Constraint Networks: Simple Temporal Networks B.Execution Management (Plan Dispatch) for STPs C.More Expressive Networks: Disjunctive Temporal Networks D.Plan Dispatch and Plan Update for DTPs E.Yet More Expressive Networks 

© Martha E. Pollack Temporal Constraints in Plans Simplest Case: precise information about the timing and duration of all events –Then dispatch is easy. In general: –Such information may be unknown and/or –such an encoding may be undesirable (inflexible), so –prefer to provide intervals on times of occurrence

© Martha E. Pollack Temporal Constraint Problems Family of constraint-satisfaction problems (CSPs), where V = events E = interval-based constraints Members of the family are defined by the form of the constraints

© Martha E. Pollack Simple Temporal Problems A Simple Temporal Problem (STP) is a constraint- satisfaction problem such that V is a set of real-valued temporal variables and E is a set of constraints of the form y - x  u, where u  R. –W.l.o.g. assume u  Z X Y Z Example STNConstraints: [0, 5] [1, 4][1,2] One Solution: 1  y – x  2 0  z – x  5 1  z – y  4 {x = 0,y = 1, z = 4} 1  y – x  2  y – x  2  x – y  - 1

© Martha E. Pollack STP Example EVENTNAME Patient enters hospitalE Start(Patient seen by doctor)DSDS End(Patient seen by doctor)DEDE Start(Patient seen by neurologist)NSNS End(Patient seen by neurologist)NENE Start(CT scan)CSCS End(CT scan)CECE Start(CT scan interpretation)ISIS End(CT scan interpretation)IEIE Start(Treatment)TSTS Start(Admission to monitored bed)ASAS Model temporal plans by associating nodes with the start and end points of each action

© Martha E. Pollack STP Example CONSTRAINTSEMANTICS D S – E  10 Door to doctor by 10 minutes N S – E  15 Access to neurologist by 15 minutes C E – E  25 Door to CT scan completion by 25 minutes I E – E  45 Door to CT scan interpretation by 45 minutes T S – E  60 Door to treatment by 60 minutes A S – E  180 Admission to monitored bed within 3 hours C E – I S  0 Scan interpretation starts after scan completion I E – T S  0 Treatment begins after scan interpretation

© Martha E. Pollack Solving STPs An STP is consistent (has a solution) if its distance graph contains no negative cycles. Can determine this in polynomial time, using all- pairs shortest path algorithms (e.g., Floyd- Warshall) If consistent, can directly “read off” one solution from the shortest path matrix—but typically there will be many others as well.

© Martha E. Pollack An Example X Y Z [0, 5] [1,2] [1, 4] X Y Z Z 40Y 520X ZYX One Solution: {x = 0,y = 2, z = 5} An alternative: {x = 0, y = 1, z = 2}

© Martha E. Pollack Another Example X Y Z [0, 1] [1,2] [1, 4] X Y Z XYZ X Y Z

© Martha E. Pollack TR’s and TW’s Use a Temporal Reference Point (TR) to specify absolute clock times Compute the Time Window (TW) for every event e –Minimal distance to/from TR X Y Z [0, 5] [1,2] [1, 4] TR [6,8]

© Martha E. Pollack Decomposability An STP is decomposable if every locally consistent assignment can be extended to a solution. X Y Z [0, 5] [1,2] [1, 4] X = 0 Z = 0, satisfying Con({X,Z}) No way to extend with an assignment to Y – not decomposable The all-pairs, shortest path graph (the d-graph) for any STP is decomposable.

© Martha E. Pollack The Dispatch Problem Given a (set of) plan(s) with temporal constraints, decide when to execute each action. For now, assume the plans are encoded as STPs.

© Martha E. Pollack Naïve Dispatch Algorithm for STPs 1.Select an event such that the current time is in its time window, and it’s enabled. 2.Assign the current time to the selected event. 3.Propagate that assignment through the STP [1, 4] TR X Y Z [0, 5] [1,2] [6,8] TimeAssignTWs 0 X: Y: Z: 6X  6 X: Y: Z: 7Y  7 X: Y: Z: 9Z  7 X: Y: Z:

© Martha E. Pollack Naïve Dispatch Algorithm for STPs 1.Select an event such that the current time is in its time window, and it’s enabled. 2.Assign the current time to the selected event. 3.Propagate that assignment through the STP TR X Y Z [0, 10] [1,1] [2,2] TimeAssignTWs 0 X: Y: 3X  3X: Y:

© Martha E. Pollack Solution #1 Before making an assignment, set the lower bounds of all TWs to “now” and propagate. TimeAssignTWs 0 X: Y: TR X Y Z [0, 10] [1,1] [2,2] 3 3 3{propagate} X: Y: 3Y  3X: Y: Works, but requires O(e + n log n) work to propagate.

© Martha E. Pollack Solution #2 Compute the all-paths shortest pair network (off- line)—can then do only local propagation (to neighbors). Works, and requires less propagation (exactly n), but can still do better. TR X Y Z X is not enabled until after Y

© Martha E. Pollack Solution #3 Compute the all-paths shortest pair network and then minimize it by deleting unneeded edges(off-line). Triangle Rule: Edge AC is dominated if there is another node B such that: |AB| + |BC| = |AC|  { |AB| < 0  |BC|  0 } TR X Y Z NASA Remote Agent Domain Pruned 40-70% of Nodes

© Martha E. Pollack Dispatch Algorithm After computing an equivalent, minimal dispatchable STP: Pick and remove an event e from A such that now  TW(E) S  S  {e} Execution-time(e)  now Propagate this assignment to the immediate neighbors of e A  A  {x | all negative edges starting at x have destinations already in S} ((I.e., x is enabled.)) Wait until now has advanced to some time between the minimum lower bound of a time window for a member of A and the minimum upper bound of a time window for a member of A. Loop to (2) until every event is in S.

© Martha E. Pollack Today’s Outline 1.Introduction 2.Satisfying Temporal Constraints during Execution A.Temporal Constraint Networks: Simple Temporal Networks B.Execution Management (Plan Dispatch) for STPs C.More Expressive Networks: Disjunctive Temporal Networks D.Plan Dispatch and Plan Update for DTPs E.Yet More Expressive Networks   

© Martha E. Pollack An Plan Management System The “Nursebot” Project (Initiative on Personal Robotics for the Elderly) Designing a cognitive orthotic (Autominder) to assist older adults with memory decline Currently deployed on a mobile robot (Pearl)

© Martha E. Pollack Autominder Example Req/OptActivityAllowedExpectedObserved Rtoilet use10:45- 11:05 Rlunch12:00- 12:45 OTV14:00- 14:30 10:55 Rtoilet use 13:55- 14:15 REMIND 12:25 REMIND 13:55 12:28

© Martha E. Pollack Client Modeler Plan Manager Personal Cognitive Orthodic Client Plan Activity Info Inferred Activity Sensor Data Reminders Client Model Info Activity Info Preferences Plan Updates Client Model Autominder Architecture

© Martha E. Pollack Dispatch (and Update) Example I TREx S Ex E [540,720][15,15] PTV S [600,600] 585

© Martha E. Pollack Plan Management Architecture Client Plan Additions And Modifications PM Control STP Encoding Of Plan and Additions or Modifications STP Solver Updated Plan

© Martha E. Pollack The Need for More Expressiveness Both breakfast and bathing must end by 8:30 a.m. Client should start breakfast between 7 and 8 a.m., and breakfast will take 20 to 30 minutes. Client should bathe, which will take 30 to 40 minutes. TR Eat S Eat E [420,480] [20,30] Bth S Bth E [30,40] These tasks cannot overlap. Disjunctive constraint: 0  Eat S – Bth E OR 0  Bth S – Eat E [0,510]

© Martha E. Pollack Disjunctive Temporal Problems A set of time points (variables) V and a set of constraints C of the form: lb ji  X i – X j  ub ji  …  lb mk  X k – X m  ub mk Solution: assignment of times to all variables, so that all constraints in C are satisfied (consistent). Generalization of the STPs and TCSPs

© Martha E. Pollack DTPs as CSPs One-Level Approach –Attempt direct assignment of times to DTP variables. –Limitations: inefficient; produces overconstrained solution Two-Level Approach –CSP variables: DTP constraints. –CSP values: Disjuncts from DTP constraints. –The constraints among the variables are implied by the semantics of the values, (not explicitly given).

© Martha E. Pollack DTP Solving Example C 1 : {c 11 : y – x  5} C 2 : {c 21 : w – y  5}  {c 22 : x – y  -10}  {c 23 : z – y  5} C 3 : {c 31 : y – w  -10} NO: c 21  c 31 NO: c 11  c 22 Component STP: C 1  c 11, C 2  c 23, C 3  c 31 One exact solution: {x = 0, y = 1, z = 2, w = 12}

© Martha E. Pollack Strategies for Efficiency Make the binary inconsistencies explicit, then use arc- consistency Use forward checking Use semantic branching Use conflict-directed backjumping Use incremental forward checking For the first layer use SAT solvers instead of CSP solvers Remove subsumed variables Introduce no-good learning

© Martha E. Pollack Semantic Branching A<BC<D Also impose B  A (I.e.  A<B) X < Y

Dispatch (and Update) Example II OLD PLAN: Client should start breakfast between 7 and 8 a.m., and breakfast will take 20 to 30 minutes. Client should bathe, which will take 30 to 40 minutes. Both breakfast and bathing must end by 8:30 a.m These tasks cannot overlap.

Dispatch (and Update) Example II OLD PLAN: Client should start breakfast between 7 and 8 a.m., and breakfast will take 20 to 30 minutes. Client should bathe, which will take 30 to 40 minutes. Both breakfast and bathing must end by 8:30 a.m These tasks cannot overlap. ADD: Client should call her son at 7:30, for a 5 minute check-in. This cannot overlap with breakfast or bathing.

Dispatch (and Update) Example II OLD PLAN: Client should start breakfast between 7 and 8 a.m., and breakfast will take 20 to 30 minutes. Client should bathe, which will take 30 to 40 minutes. Both breakfast and bathing must end by 8:30 a.m These tasks cannot overlap. ADD: Client should call her son at 7:30, for a 5 minute check-in. This cannot overlap with breakfast or bathing. DERIVE: Start breakfast by 7:10 or after 7:35; start bath by 7:00 or after 7:35; start one or the other by 7:40, adjusting maximum durations.

Plan Manager Architecture [New Activity or Plan Modification] Client Plan Additions and Modifications PM Control DTP Encoding Of Plan, Addition or Modification, And Conflict Resolution Alternatives DTP Solver (Epilitis) Updated Plan

© Martha E. Pollack Dispatch Example III OLD PLAN: Client should start breakfast between 7 and 8 a.m., and breakfast will take 20 to 30 minutes. Client should bathe, which will take 30 to 40 minutes. Both breakfast and bathing must end by 8:30 a.m These tasks cannot overlap. TIME BOUND PASSED: 7:30 passes with neither action begun.

© Martha E. Pollack Dispatch Example III OLD PLAN: Client should start breakfast between 7 and 8 a.m., and breakfast will take 20 to 30 minutes. Client should bathe, which will take 30 to 40 minutes. Both breakfast and bathing must end by 8:30 a.m These tasks cannot overlap. TIME BOUND PASSED: 7:30 passes with neither action begun. DERIVE: Don’t begin bath until after breakfast complete.

© Martha E. Pollack Execution Tracking Example TR Eat S Eat E [420,480] [20,30] Bth S Bth E [30,40] Disjunctive constraint: 0  Eat S – Bth E OR 0  Bth S – Eat E [0,510] The one DTP...

© Martha E. Pollack Execution Tracking Example TREat S Eat E Bth S Bth E... Encodes 2 STPs [420,480][20,30][30,40] [0,510] TRBth S Bth E Eat S Eat E [30,40][20,30] [0,510] [420,480]

© Martha E. Pollack Plan Manager Architecture [Time Bound Passed or Event Occurred] Client Plan Clock Alarm PM Control DTP Encoding Of Plan and New Execution Constraint DTP Solver (Epilitis) Updated Plan

© Martha E. Pollack Today’s Outline 1.Introduction 2.Satisfying Temporal Constraints during Execution A.Temporal Constraint Networks: Simple Temporal Networks B.Execution Management (Plan Dispatch) for STPs C.More Expressive Networks: Disjunctive Temporal Networks D.Plan Dispatch and Plan Update for DTPs E.Yet More Expressive Networks     

© Martha E. Pollack Handling Temporal Uncertainty TP-u (e.g., STP-u) Distinguish between two kinds of events: –Controllable: the executing agent controls the time of occurrence –Uncontrollable: “nature” controls the time of occurrence X X Controllable edge (Y controllable event) Uncontrollable edge (Y uncontrollable event) Y Y

© Martha E. Pollack Three Notions of “Solution” Strongly Controllable: There is an assignment of time points to the controllable events such that the constraints will be satisfied regardless of when the uncontrollables occur. Weakly Controllable: For each outcome of the uncontrollables, there is an assignment of time points to the controllables such that the constraints are satisfied. Dynamically Controllable: As time progresses and uncontrollables occur, assignments can be made to the controllables such that the constraints are satisfiedl

© Martha E. Pollack Controllability in STP-u’s X Y Z [0,10] [1,5] [2,4] Strongly Controllable {X=0, Z = 5} X Y Z [0,10] [1,1] [2,4] X Y Z [0,10] [1,1] [2,4] Dynamically Controllable {X=0, Z = Y + 1} Weakly Controllable {X=0, Z = Y – 1} Strong => Dynamic => Weak

© Martha E. Pollack Handling Causal Uncertainty CTP (e.g., CSTP) Label each node—events are executed only if their associated label is true (at a specified observation time) Obs (A) X Y A ~A Conditional Plan Obs(A) X Y A ~A [5,10] [8,12] CTP

© Martha E. Pollack Conditional Plan as CTP Travel from Home to S, but if the road is blocked from B to S, go to P. If you go to S, arrive after 1p.m. (to take advantage of the discounts). If you go to P, arrive at C by 11 a.m. (because traffic gets heavy).

© Martha E. Pollack Strong Consistency Not strongly consistent: Must not be at B before 12 (if A is true); must be at B by 10 (if A is false)— and can’t observe A until you’re at B.

© Martha E. Pollack Weak Consistency Weakly consistent: When A is true, leave home after 10 (and all other assignments directly follow). When A is false, leave home by 9.

© Martha E. Pollack Dynamic Consistency Not dynamically consistent: Can’t tell when you need to leave home until it’s too late. Variant that is is dynamically consistent: Add a parking lot at B where you can wait.