Presentation is loading. Please wait.

Presentation is loading. Please wait.

Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:

Similar presentations


Presentation on theme: "Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:"— Presentation transcript:

1 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 CMSC 722, AI Planning Planning and Scheduling Dana S. Nau Dept. of Computer Science, and Institute for Systems Research University of Maryland

2 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/ 2 Scheduling l Given: u actions to perform u set of resources to use u time constraints l Objective: u allocate times and resources to the actions l What is a resource? u Usually represented as a numeric quantity u Actions modify it in a relative way u Several concurrent actions may use the same resource

3 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/ 3 Planning and Scheduling l Scheduling has usually been addressed separately from planning u Thus, will give an overview of scheduling algorithms l In some cases, cannot decompose them so cleanly u Thus, will discuss how to integrate them

4 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/ 4 Scheduling Problem l Scheduling problem u set of resources and their future availability u actions and their resource requirements u constraints u cost function l Schedule u allocations of resources and start times to actions »must meet the constraints and resource requirements

5 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/ 5 l Action a u resource requirements »which resources, what quantities u start time s(a), end time e(a), duration d(a) u usually, upper and lower bounds »s(a) in [s min (a),s max (a)] »e(a) in [e min (a),e max (a)] l Non-preemptive action: cannot be interrupted l Preemptive action: can interrupt and resume u d(a) = sum { d i (a) ≤ e(a)–s(a) | i in I} u can have constraints on the intervals

6 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/ 6 Resources l Reusable resource r u “borrowed” by an action, and released afterward »e.g., use a tool, return it when done u total capacity Q r, may be either discrete or continuous u current level z r (t) in [0,Q r ] »e.g., five cranes at a location Q r = 5, and 5 ≥ z r (t) ≥ 0 u if action requires quantity q of r, then diminish z r by q at time s(a), increase it by q at time e(a)

7 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/ 7 l Consumable resource r u “consumed” (or in some cases produced) by an action u afterwards, does not revert to previous value u e.g., use fuel u total capacity Q r u current level z r (t) in [0,Q r ]

8 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/ 8 l Resource requirement of an action is a conjunct of assertions u consume(a,r j,q j ) & … l or disjunct if there are alternatives  consume(a,r j,q j ) v … l z r is called the “resource profile” for z

9 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/ 9 Constraints l Bounds on start and end points of an action u absolute times »e.g., a deadline: e(a) ≤ u »release date: s(a) ≥ v u relative times »latency: s(b)–e(a) in [u,v] »total extent: e(a)–s(a) in [u,v] l Constraints on availability of a resource u e.g., can only communicate with a satellite at certain times

10 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/ 10 Costs l may be fixed l may be a function of quantity and duration u e.g., set-up cost plus run-time cost l e.g., suppose a follows b u cost c r (a,b) for a u duration d r (a,b), i.e., s(b) ≥ e(a) + d r (a,b)

11 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/ 11 l Objective: minimize some function of the various costs and/or end-times

12 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/ 12 Types of Scheduling Problems l Machine scheduling u machine i: unit capacity (in use or not in use) u job j: partially ordered set of actions a j1, …, a jk u schedule: »a machine i for each action a jk »a time interval during which i processes a jk »no two actions can use the same machine at once u actions in different jobs are completely independent u actions in the same job cannot overlap »e.g., actions to be performed on the same physical object

13 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/ 13 l Single-stage machine scheduling u each job is a single action, and can be processed on any machine u identical parallel machines »processing time p j is the same regardless of which machine can model all m machines as a single resource of capacity m u uniform parallel machines »machine i has speed(i); time for j is p j /speed(i) u unrelated parallel machines »different time for each combination of job and machine

14 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/ 14 l Multiple-stage scheduling problems u job contains several actions u each requires a particular machine u flow-shop problems: »each job j has exactly m actions {a ji | j = 1, …, m} »each a ji needs to be done on machine i »actions must be done in order a j1, a j2, …, a jm u open-shop problems »like flow-shop, but can do actions in any order u job-shop problems (general case) »constraints on order of actions, which machine for each action

15 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/ 15 Example l Job shop, machines m 1, m 2, m 3, jobs j 1, …, j 5. l j 1 : u m 2 for 3 time units, m 1 for 3 time units, m 3 for 6 time units l j 2 : l j 3 : l j 4 : l j 5 :

16 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/ 16 Notation l Standard notation for designating machine scheduling problems:  |  |   = type of problem: P (identical), U (uniform), R (unrelated) parallel machines F (flow shop), O (open shop), J (job shop)  = job characteristics (deadlines, setup times, precedence constraints), empty if there are no constraints  = the objective function l Examples: u Pm |  j |  j w j e j »m identical parallel machines, deadlines on jobs, minimize weighted completion time u J | prec | makespan »job shop with arbitrary number of machines, precedence constrants between jobs, minimize the makespan

17 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/ 17 Complexity l Most machine scheduling problems are NP-hard l There are many polynomial-time reductions P - identical parallel machines U - uniform parallel machines R - unrelated parallel machines F - flow shop O - open shop J - job shop

18 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/ 18 Solving Machine Scheduling Problems l Integer Programming (IP) formulations u n-dimensional space u Set of constraints C, all are linear inequalities u Linear objective function f u Find a point p=(x 1,…, x n ) such that »p satisfies C »p is integer-valued, i.e., every x i is an integer »no other integer-valued point p’ satisfies C and has f(p') < f(p) l A huge number of problems can be translated into this format l An entire subfield of Operations Research is devoted to Integer Programming u Several commercial IP solvers

19 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/ 19 IP Solvers l Most IP solvers use depth-first branch-and-bound l Depth-first backtracking u Node selection is guided by a lower bound function L(u) »For every node u, L(u) ≤ {f(v) : v is a descendant of u} procedure DFBB global u*  nil; f*  ∞ call search(r), where r is the initial node return (u*,f*) procedure search(u) if u is a solution and f(u) < f* then u*  u; f*  f(u) else if u has no unvisited children or L(u) ≥ f(u*) then do nothing else call search(v), where v = argmin{L(v) : v is a not-yet-visited child of u} L(u) is similar to A*’s heuristic function f(u) = g(u)+h(u) A* can be expressed as a best-first branch-and- bound procedure

20 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/ 20 Planning as Scheduling l Some planning problems can be modeled as machine-scheduling problems l Example: modified version of DWR u m identical robots, several distinct locations u job: container-transportation(c,l,l') »processed by a single robot go to l, load c, go to l', unload c u release dates, deadlines, durations u setup time t ijk if robot i does job j after performing job k u minimize weighted completion time l Can generalize the example to account for the following: u cranes for loading/unloading u arrangement of containers into piles l But can’t handle the part I said to ignore Let’s ignore this for a moment

21 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/ 21 Limitations l Some other things cause problems too:

22 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/ 22 Integrating Planning and Scheduling l Extend the chronicle representation to include resources u finite set Z={z 1,…,z m } of resource variables »z i is the resource profile for resource i l Like we did with other state variables, will use function-and- arguments notation to represent resource profiles u cranes(l) = number of cranes available at location l l Will focus on reusable resources u resources are borrowed but not consumed

23 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/ 23 Temporal Assertions l Resource variable z whose total capacity is Q l A temporal assertion on z is one of the following:

24 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/ 24 Temporal Assertions (Continued)

25 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/ 25 Example: same figure as before.

26 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/ 26 l Assume distinct resources are completely independent u Using a resource z does not affect another resource z' u Every assertion about a resource concerns just one resource l Don’t need consistency requirements for assertions about different resource variables u Just for assertions about the same variable

27 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/ 27

28 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/ 28 Consistency l A chronicle is consistent if u Temporal assertions on state variables are consistent »in the sense specified in Chapter 14 u No conflicts among temporal assertions

29 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/ 29 Example l DWR domain, but locations may hold more than one robot  Resource variable space (l) = number of available spots at location l u Each robot requires one spot

30 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/ 30 l Also need to specify total capacity of each resource l One way: fixed total capacity Q for {space(l) : l is a location} u Example: Q = 12 »At most 12 spots in each location »If location loc1 has only 4 spots then the initial chronicle will contain space(loc1)@[0,oo):8 l Another way: make Q depend on the location l Q(loc1) = 4, Q(loc2) = 12, … l Suppose we’re only trying to find a feasible plan, not an optimal one u Then except for the resources, our definitions of planning domain, planning problem, etc. are basically the same as in Chapter 14

31 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/ 31

32 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/ 32

33 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/ 33

34 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/ 34

35 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/ 35

36 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/ 36

37 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/ 37 l Can use such constraints to resolve resource-conflict flaws

38 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/ 38

39 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/ 39

40 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/ 40 Three main steps: l solve open-goal flaws l solve threat flaws l solve resource-conflict flaws


Download ppt "Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:"

Similar presentations


Ads by Google