Planning Acting Chapter 12 Scheduling 12 1 Planning



















- Slides: 19
Planning & Acting Chapter 12 Scheduling (12. 1), Planning and Acting in nondetermininistic domains (12. 3), Conditional planning (12. 4), Replanning (12. 5), and Continuous planning (12. 6). CSE 471/598 by H. Liu Copyright, 1996 © Dale Carnegie & Associates, Inc.
Time in planning - Scheduling Planning so far does not specify how long an action takes, when an action occurs, except to say that is before or after another action n When used in real world, such as scheduling Hubble Space Telescope observations, time is also a resource/constraint Job shop scheduling – time is essential An example of Figures 12. 1 and 12. 2 n n A partial order plan (with durations) Critical path (or the weakest link) Slack = LS (latest start) – ES (earliest start) Schedule = plan + time (durations for actions) Scheduling with resource constraints n n When certain parts are not available, waiting time should be minimized Difference in completing which first and possible change in Fig 12. 4 CSE 471/598 by H. Liu 2
Some assumptions with planning The world is accessible, static, deterministic. Action descriptions are correct & complete with exact stated consequences. However, the real world is not that perfect. So, how can we handle partially accessible, dynamic, non-deterministic world with incomplete information? n What do we usually do? CSE 471/598 by H. Liu 3
Anticipating the possible contingencies To deal with incorrect, incomplete information Bounded indeterminacy n n unexpected effects can be enumerated Conditional POP can handle it Unbounded indeterminacy n n n In complicated cases, no complete enumeration is possible Plan for some contingencies Replan for the rest CSE 471/598 by H. Liu 4
Non-Classical Planning Contingency n n Conditional planning Sensing actions Execution monitoring n n monitoring what is happening while it executes the plan telling when things go wrong Replanning n finding a way to achieve its goals from the new situation (something went wrong according to old plan) Continuous planning n Persist over lifetime (e. g. , Mars rovers) CSE 471/598 by H. Liu 5
Painting chair and table Init: a chair, a table, cans of paints with unknown color Goal: the chair and table have the same color Different types of planning n n n Classic planning: fully observable? Sensorless planning: coercing Conditional planning with sensing: (1) already the same, (2) one painted with the available color, (3) paint both Replanning: paint, check the effect, replan for missing spot Continuous planning: paint, can stop for unexpected events, continue CSE 471/598 by H. Liu 6
Conditional planning (1) CP in fully observable environments (FOE) n n n Vacuum world with actions Left, Right, and Suck Disjunctive effects: if Left sometime fails, then Action (Left, Precond: At. R, Effect: At. L v At. R) Conditional effects: Action(Suck, Precond: , Effect: (when At. L: Clean. L) ^ (when At. R: Clean. R) Action (Left, Precond: At. R, Effect: At. L v (At. L^when Clean. L: !Clearn. L) Conditional steps for creating conditional plans: if test then plan. A else plan. B e. g. , if At. L ^ Clean. L then Right else Suck The search tree for the vacuum world (Fig 12. 9) w State nodes (squares) and chance nodes (circles) CSE 471/598 by H. Liu 7
Conditional planning (2) CP in partially observable environments (POE) n n Initial state is a state set – a belief state (Fig 3. 21, p 85) Determine “both squares are clean” with local dirt sensing w the vacuum agent is At. R and knows about R, how about L? w Dirt can sometimes be left behind when the agent leaves a clean square n n A graph representation (Figure 12. 12, p 438) How different between in FOE and in POE w Which one is a special case of the other? CSE 471/598 by H. Liu 8
Sensing Automatic sensing n At every step, the agent gets all the available percepts Active sensing n Percepts are obtained only by executing specific sensory actions w Precond and when conditions are plain propositions, not knowledge propositions n n K(P) is defined as “knows that P is true”, !K as not knows; what does (12. 2, p 440) mean? Check. Dirt (12. 3, p 440), Check. Location actions CSE 471/598 by H. Liu 9
Replanning via monitoring In reality, something can go wrong. How can a replanning agent know that? 1. 2. annotate a plan at each step with preconditions required for successful completion of the remaining steps detect a potential failure by comparing the current preconditions with the state description from percepts Sensing and monitoring n Execution monitoring - see what happens when executing a plan w Action monitoring w Plan monitoring CSE 471/598 by H. Liu 10
Replanning Action monitoring n n n Before carrying out the next action of a plan check the preconditions of each action as it is executed rather than checking the preconditions of the entire remaining plan A schematic illustration (Fig 12. 14) work well with realistic systems (action failures) Return to the chair-table painting problem (page 443) Plan: [Start; Open(BC); Paint(Table, Blue); Finish] w What if it missed a spot of green on the table? n n Loop is created by plan-execute-replan, or no explicit loop Failure is only detected after an action is performed CSE 471/598 by H. Liu 11
Plan monitoring n n Detect failure by checking the preconditions for success of the entire remaining plan Useful when a goal is serendipitously achieved w While you’re painting the chair, someone comes painting the table with the same color n Cut off execution of a doomed plan and don’t continue until the failure actually occurs w While you’re painting the chair, someone comes painting the table with a different color If one insists on checking every precondition, it might never get around to actually doing anything n Why? CSE 471/598 by H. Liu 12
Difference between CP & RP Unpainted area will make the agent to repaint until the chair is fully painted. Is it different from the loop of repainting in conditional planning? The difference lies in the time at which the computation is done and the information is available to the computation process n n CP - anticipates uneven paint RP - monitors during execution CSE 471/598 by H. Liu 13
Combining planning & execution Continuous planning agent execute some steps ready to be executed n refine the plan to resolve standard deficiencies n refine the plan with additional information n fix the plan according to unexpected changes w recover from execution errors w remove steps that have been made redundant Goal ->Partial Plan->Some actions-> Monitoring the world -> New Goal n CSE 471/598 by H. Liu 14
Continuous Planning - Revisit the blocks world Goal: On(C, D)^On(D, B) Action(Move(x, y), Pre: Clear(x)^Clear(y)^On(x, z), Eff: On(x, y)^Clear(z)^!Clear(y)^!On(x, z)) Fig 12. 15 – 12. 21 Start is used as the label for the current state. CSE 471/598 by H. Liu 15
Plan and execution Steps in execution: n n Ordering - Move(D, B), then Move(C, D) Another agent did Move(D, B) - change the plan Remove the redundant step Make a mistake, so On(C, A) w Still one open condition n Planning one more time - Move(C, D) n Final state: start -> finish CSE 471/598 by H. Liu 16
Conditional Planning and Replanning Conditional planning n n The number of possible conditions vs. the number of steps in the plan Only one set of conditions will occur Replanning n n Fix problems as they arise during execution Fragile plans due to replanning Intermediate planning between CP & RP n n The most likely ones done by CP The rest done by RP CSE 471/598 by H. Liu 17
Some general methods to deal with uncertainties: Coercion and abstraction Coercion - forcing the state with unknown into a known state to reduce uncertainty n n Paint Table and Chair together How about the job interview problem Abstraction - ignore details until it’s necessary, another tool for least commitment n A travel case - Fly(Phoenix, NY) w After arrival, look for accommodation Aggregation - a form of abstraction, or summary n Dealing with a large number of objects CSE 471/598 by H. Liu 18
Summary The unexpected or unknown occurs In order to overcome that, we need CP or RP There exists incorrectness or incompleteness, we need to monitor the result of planning: execution or action monitoring CP and RP are different and have different strengths Reducing uncertainty via coercion, abstraction and aggregation CSE 471/598 by H. Liu 19