1 / 234

Planning with Resources

Planning with Resources. Philippe Laborie plaborie@ilog.fr ILOG. Foreword. Applications of AI Planning. Aerospace Space - Satellite, Launcher manufacturing - Launch site operations - Spacecraft operations - Space users - Autonomous space exploration Aviation

bart
Download Presentation

Planning with Resources

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Planning with Resources Philippe Laborie plaborie@ilog.fr ILOG

  2. Foreword Applications of AI Planning Aerospace Space - Satellite, Launcher manufacturing - Launch site operations - Spacecraft operations - Space users - Autonomous space exploration Aviation - Manufacturers and suppliers - Airlines, Airports - Maintenance and repair organizations - Air Traffic Control PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

  3. Foreword Applications of AI Planning Defense Military logistic applications Rescue and Military operations planning Non-combatant Evacuation Operations Emergency Assistance Air Campaign Planning Army Unit Operations Coalition Operations PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

  4. Foreword Applications of AI Planning New information technology Planning & Scheduling for the Web Workflow, Business Process Management Systems Management Aids Help Desks and Assistants Personal Assistants Data analysis tasks, Database query Virtual reality or other simulated environments Computer games (bridge) PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

  5. Foreword Applications of AI Planning Industry Process planning Factory automation - Production line scheduling - Assembly planning - Maintenance planning Electronic design and manufacturing Logistics Project planning Construction planning Engineering Tasks Management Tasks PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

  6. Foreword Applications of AI Planning Civil Security and Environment Crisis Management Evacuation Planning Search & Rescue Coordination Oil Spill Response Medical Applications Bioinformatics Personal Active Medical Assistant PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

  7. Foreword Applications of AI Planning What most of these applications have in common ? Manufacturing:A grinding operation requires a grinding machine. The grinding machine can perform only one operation at a time. Only one grinding machine is available in the shop. Project Management:In a web site development project, the task of testing browsers compatibility requires an effort of 6 person-months of a quality engineer. 5 quality engineers are available. Satellite:When the satellite is not within range of a receiving station, it can store images on an onboard solid-state memory that provides a capacity of 90 Gbits (550 images). Crisis Management:An aircraft B737-200 has a capacity to evacuate at most 120 people. Maximum cargo loading is 3,400kg for a volume of 14.3 m3. Maximal range of the aircraft is 2480km. … they need the ability to reason about resources PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

  8. Overview Planning with Resources • Part I. State of the Art Overview • Definition of a Resource • Problem Modeling • Problem Solving • Part II.Focus on Constraint-Based Approaches • Constraint-Programming • Problem Modeling • Problem Solving • Constraint Propagation • Search PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

  9. Planning with ResourcesPart I: State of the Art Overview

  10. Manufacturing:A grinding operation requires a grinding machine. The grinding machine can perform only one operation at a time. Only one grinding machine is available in the shop. • The grinding machine is a resource. It constrains the grinding operations to execute sequentially on the machine. 1 0 time Grinding-op1 Grinding-op3 Grinding-op2 State of the Art Definition of a Resource • A resource is any substance or (set of) object(s) whose cost or available quantity induce some constraint on the operations that use it PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

  11. Project Management:In a web site development project, the task of testing browsers compatibility requires an effort of 6 person-months of a quality engineer. 5 quality engineers are available. 5 • The team of quality engineers is a resource. It constrains the number of tasks that can be executed in parallel and the duration of these tasks. 0 3 months 2 engineers Web-site-dev1 time Test-software1 State of the Art Definition of a Resource • A resource is any substance or (set of) object(s) whose cost or available quantity induce some constraint on the operations that use it PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

  12. Satellite:When the satellite is not within range of a receiving station, it can store images on an onboard solid-state memory that provides a capacity of 90 Gbits (550 images). 550 • The solid-state memory is a resource. It constrains the number of images that can be taken between two periods of visibility of the receiving station. 0 time Pic1 Pic2 Pic5 Pic3 Pic4 Send-data State of the Art Definition of a Resource • A resource is any substance or (set of) object(s) whose cost or available quantity induce some constraint on the operations that use it PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

  13. Crisis Management:An aircraft B737-200 has a capacity to evacuate at most 120 people. Maximum cargo loading is 3,400kg for a volume of 14.3 m3. Maximal range of the aircraft is 2480km. 3400 • The seat capacity of the B737-20 is a resource. It constrains the number of people the plane can evacuate in a single flight. The cargo capacity of the B737-20 is another resource. It constrains the weight the aircraft can transport in a single flight. Etc... 0 time Load-car Unload-truck Load-truck Unload-car State of the Art Definition of a Resource • A resource is any substance or (set of) object(s) whose cost or available quantity induce some constraint on the operations that use it PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

  14. State of the Art Definition of a Resource • Resources Typology • Unary resource: Resource of capacity 1. Two activities requiring the same unary resource cannot overlap • Discrete resource: Resource of capacity Q. Activities requiring the same discrete resource can overlap provided the resource capacity Q is not exceeded • Reservoir: Resource of capacity Q and initial level L; Activities may consume or produce the reservoir. The level of the reservoir over time must be kept in the interval [0,Q] PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

  15. State of the Art Definition of a Resource unary resource availability 1 0 time Op1 Op2 PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

  16. State of the Art Definition of a Resource discrete resource availability Q 0 time Op1 Op2 PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

  17. {R1,…,Ri,…,Rj,…,RQ} Op1 {R1,…,Ri,…,Rj,…,RQ} Opi {R1,…,Ri,…,Rj,…,RQ} Opj {R1,…,Ri,…,Rj,…,RQ} OpQ {R1,…,Ri,…,Rj,…,RQ} OpQ+1 State of the Art Definition of a Resource • In theory, a discrete resource of maximal capacity Q can be represented as Q unary resources No solution after trying Q! allocations PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

  18. State of the Art Definition of a Resource reservoir level Q 0 time Op1 Op3 Op2 PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

  19. State of the Art Definition of a Resource • Resources are tightly linked with the notions of time & concurrency • For unary and discrete resources, activities use the resource over some time interval • Handling parallel execution of activities is necessary to take advantage of non-unitary capacities • There may exist complex relations linking the duration of an activity with the amount of resource it uses, consumes and/or produces PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

  20. State of the Art Definition of a Resource • Resources may impose other constraints than just capacity • State constraints : two activities requiring the resource to be in incompatible states cannot overlap • Minimal transition time between two consecutive activities using the same unary resource • Batching: two overlapping activities using the same resource must start and end at the same time • These additional constraints can generally be expressed by classical planning predicates PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

  21. State of the Art Definition of a Resource • So … the hard point for planning with resources is mainly the management of • Numerical time and • Numerical capacity/availability PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

  22. State of the Art Problem Modeling: STRIPS • How hard is it to model time and capacities in STRIPS ? • Exercise. Build a STRIPS model for the following domain A task to test a web-site lasts for 3 months and requires 2 quality engineers (out of 5 available). As a result of the task, the web-site is tested. Other tasks also have duration and compete for the same resource. The model must correctly handle task parallelism. PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

  23. State of the Art Problem Modeling : STRIPS • Difficulty #1: Numerical quantities • No integer arithmetic is available in STRIPS. We need to provide one. • In domain description (:predicates (plus ?i ?j ?k)) • In problem definition (:objects _0 _1 _2 _3 _4 _5 _6 _7 _8 … ) (:init (plus _0 _1 _1)(plus _1 _1 _2)(plus _2 _1 _3) … (plus _0 _2 _2)(plus _1 _2 _3)(plus _2 _2 _4) … ) PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

  24. State of the Art Problem Modeling : STRIPS • Difficulty #1: Numerical quantities • No integer arithmetic is available in STRIPS. We need to provide one. • Example of action that increase a quantity (:action IncreaseQuantity :parameters (?i ?d ?j) :precondition (and (quantity ?i) (plus ?i ?d ?j)) ; ?j == ?i + ?d :effect (and (not (quantity ?i)) (quantity ?j))) PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

  25. State of the Art Problem Modeling : STRIPS • Difficulty #2: Discrete Resource • The task is a time interval over which the resource is used. • Two actions to represent the task (:action TestWebSite-Start :parameters (?q2 ?q0) :precondition (and (free-engineers ?q2) (plus ?q0 _2 ?q2)) :effect (and (not (free-engineers ?q2)) (free-engineers ?q0))) PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

  26. State of the Art Problem Modeling : STRIPS • Difficulty #2: Discrete Resource • The task is a time interval over which the resource is used. • Two actions to represent the task (:action TestWebSite-End :parameters (?q0 ?q2) :precondition (and (free-engineers ?q0) (plus ?q0 _2 ?q2)) :effect (and (not (free-engineers ?q0)) (free-engineers ?q2) (web-site-tested))) PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

  27. State of the Art Problem Modeling : STRIPS • Difficulty #2: Discrete Resource • The task is a time interval over which the resource is used. • Initially, the amount of resource is 5: (:init (free-engineers _5) … ) PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

  28. State of the Art Problem Modeling : STRIPS • Difficulty #3: Task Duration • Use a predicate startedAtTask to record when the task was started and a global clock clock to measure time (:predicates (clock ?t) (testwebsite_started_at ?t) … ) (:action TestWebSite-Start :parameters (?t0 … ) :precondition (and (clock ?t0) … ) :effect (and (testwebsite_started_at ?t0) … )) PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

  29. State of the Art Problem Modeling : STRIPS • Difficulty #3: Task Duration (:action TestWebSite-End :parameters (?t3 ?t0 … ) :precondition (and (testwebsite_started_at ?t0) (clock ?t3) (plus ?t0 _3 ?t3) … ) :effect (and (not (testwebsite_started_at ?t0) … ))) PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

  30. State of the Art Problem Modeling : STRIPS • Difficulty #3: Task Duration • Now we only need an action to increase time when necessary: (:action Tick :parameters (?t0 ?t1) :precondition (and (clock ?t0) (plus ?t0 _1 t1)) :effect (and (not (clock ?t0)) (clock ?t1))) • We start at time 0: (:init (clock I0) … ) PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

  31. State of the Art Problem Modeling : STRIPS • Conclusion • It is possible to represent time and resources in STRIPS • BUT … the model is not completely intuitive • No built-in arithmetic • A relative change on a resource (free-engineers -= 2) is represented by two absolute changes: (DEL (free-engineers ?x)) (ADD (free-engineers ?x+2)) • Representation of time is not natural (action TICK) PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

  32. (PRECOND (free-engineers ?x1)(plus ?x1 _1 ?x2)) • (DEL (free-engineers ?x1)) • (ADD (free-engineers ?x2)) MUTEX • (PRECOND (free-engineers ?y1)(plus ?y1 _1 ?y2)) • (DEL (free-engineers ?y1)) • (ADD (free-engineers ?y2)) State of the Art Problem Modeling : STRIPS • Conclusion • A relative change on a resource is represented by two absolute changes PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

  33. Test Software Training TestWebSite engineers Test Software TestWebSite Training 150s 580s State of the Art Problem Modeling : STRIPS • Conclusion • AND what about the performances ? 26s PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

  34. State of the Art Problem Modeling • Beyond STRIPS • Standalone languages • PDDL2.1BTPL • Planning systems (language) • parcPLANO-Plan • IXTETASPEN RAX-PS PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

  35. State of the Art Problem Modeling : PDDL 2.1 • PDDL 2.1 was developed for the AIPS-2002 Planning Competition [Fox&Long 2002] • Extension of PDDL [McDermott&al 1998] for domains involving time and other numeric-valued resources • PDDL 2.1 • Level 1: “Classical” propositional planning • Level 2: Numeric Variables • Level 3: Durative actions, No continuous effects • Level 4: Durative actions, continuous effects PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

  36. State of the Art Problem Modeling : PDDL 2.1 • Numeric variables (:functions (free-engineers) ) (:action Hire :parameters ( ?n ) :precondition ( … ) :effect (and (increase (free-engineers) ?n) … )) PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

  37. State of the Art Problem Modeling : PDDL 2.1 • Numeric variables Conditions: (= (f ?x) ?q) (< (f ?x) ?q) (> (f ?x) ?q) (<= (f ?x) ?q) (>= (f ?x) ?q) Effects: (increase (f ?x) ?q) ; f(?x) += ?q (decrease (f ?x) ?q) ; f(?x) -= ?q (scale-up (f ?x) ?q) ; f(?x) *= ?q (scale-down (f ?x) ?q) ; f(?x) /= ?q (assign (f ?x) ?q) ; f(?x) = ?q PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

  38. Action duration Start End Conditions at start Effects at start Conditions at end Effects at end Invariant State of the Art Problem Modeling : PDDL 2.1 • Durative actions PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

  39. State of the Art Problem Modeling : PDDL 2.1 • Durative actions (:functions (free-engineers) ) (:action TestWebSite :parameters ( ) :duration (= ?duration 3) :condition (and (at start (>= (free-engineers) 2))) :effect (and (at start (decrease (free-engineers) 2)) (at end (increase (free-engineers) 2)) (at end (website_tested)))) PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

  40. State of the Art Problem Modeling : BTPL • Basic Temporal Planning Language [Brenner 2001] • Extension of PDDL. Focus on time and concurrency. • Whereas PDDL2.1 represents an action with two events (start and end), BTPL allows for more complex actions involving several events • No relative changes on numerical attributes (increase/decrease) as in PDDL2.1 PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

  41. pre A c1 ue1 e1 d1 c2 ue2 e2 d2 State of the Art Problem Modeling : BTPL • A BTPL ground action is a tuple a=(pre, eff) where • pre are preconditions (set of literals) • eff = {ue1,..,uen} is a set of unit events of the form ue=(c,e,d) describing the (conditional) effects of A • d: delay (rational number) • c: condition of ue: set of literals to be satisfied at t+d • e: effect of ue: add/delete list occurring at t+d PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

  42. (code_ok ?x ?y) (card_in ?y) (cash-out) DialCode(?x) 5 (ticket) 7 not (cash-out) not(card_in ?y) 10 (cash-out) TakeCash() InsertCard(?y) not(cash-out) (have_cash) (card_in ?y) 1 1 State of the Art Problem Modeling : BTPL • Example: ATM cash dispenser PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

  43. pre: (p,d1,d2) t t-d1 t-d2 A c: (q,d3,d4) t’-d4 t’-d3 ue e d t’=t+d State of the Art Problem Modeling : BTPL • BTPL extension • Allow expressing action preconditions (pre) and event conditions (c)that hold over time intervals [t1,t2) before the action or event time-point. PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

  44. State of the Art Problem Modeling : parcPLAN • parcPLAN • [Lever&Richards 1994, ElKholy&Richards 1996] • Rich temporal expressivity based on time-intervals whose extremities are time-point variables E.g.: position(robot,r1)@(t1,t2) • Expression of minimal/maximal delays between time points E.g.: t1+5  t2 • Handle unary and discrete resources, no reservoir PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

  45. State of the Art Problem Modeling : parcPLAN • Web-site project example action develop(?website)@(start,end) { conditions: designed(?website)@(t1,t2), implemented(?website)@(t3,t4), tested(?website)@(end,t); effects: developped(?website)@(end,t); constraints: designates(?website, WEBSITE), start <= t1 <= t2 <= t3 <= t4 <= end <= t, end <= start + 18; } PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

  46. State of the Art Problem Modeling : parcPLAN • Web-site project example action test_in_company(?website)@(start,end){ effects: tested(?website)@(end,t); resources: requires(engineers(),2)@(start,end); constraints: designates(?website, WEBSITE), end <= t, end = start + 3; } action test_outsource(?website)@(start,end){ effects: tested(?website)@(end,t); constraints: designates(?website, WEBSITE), end <= t, end = start + 4; } PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

  47. State of the Art Problem Modeling : IXTET • IXTET [Ghallab&Laruelle 1994, Laborie&Ghallab 1995]is a temporal and resource planner • From IndeXed TimE Table • State of the world is represented by a set of valued attributes (state variables) • Relies on time-points as elementary temporal primitives • Allow representation of unary, discrete and reservoir resources PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

  48. State of the Art Problem Modeling : IXTET • State of the world is represented by a set of valued attributes (state variables) E.g.: color(car):red position(robot):r1 • Conditions are expressed over time intervals E.g.: hold(position(robot):r1,(t1,t2)) • Change is represented via the notion of event associated with a time-point E.g.: event(position(robot):(r1,r2), t) PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

  49. State of the Art Problem Modeling : IXTET • Minimal/Maximal delays can be expressed between time-points E.g.: t in [0, 12] t2-t1 in [3, 5] • Unary and discrete resources can be used over time-intervals E.g.: use(engineers():2, (t1,t2)) • Reservoir can be produced/consumed at time-points E.g.: consumes(money():100,t) PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

  50. State of the Art Problem Modeling : IXTET • Web-site project example • IXTET operators are called task task develop(?website)(t) { ?website in WEBSITES; timepoint t1, t2; hold(status(?website):designed, (t1,t2)); hold(status(?website):implemented, (t2,t)); hold(status(?website):tested, (t,end)); start <= t1 <= t2 <= t <= end; (end - start) in [0,18]; } PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

More Related