1 / 73

Machine Intelligence

Cairo University Faculty of Engineering Computer Engineering Department. Machine Intelligence. Course Instructor: Prof. Dr. Nevin Darwish. Team members. Sylvia Boshra Lydia Wahid Madonna Samuel Wessam Wagdy.

cardea
Download Presentation

Machine Intelligence

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. Cairo University Faculty of Engineering Computer Engineering Department Machine Intelligence Course Instructor: Prof. Dr. NevinDarwish

  2. Team members • Sylvia Boshra • Lydia Wahid • Madonna Samuel • WessamWagdy

  3. Artificial Intelligence A Modern Approach 3rd Edition Chapter 11

  4. Planning and Acting in the Real World

  5. Agenda • Recall classical planning • Types of the environment • Methods To deal with different types of the environment • Sensorless (Conformant)Planning • Contingent Planning • Online Replanning • Multiagent Planning • Planning with multiple simultaneous actions • Planning with multiple agents • Summary

  6. 1. Recall Classical Planning • Classical Planning • Example: The spare tire problem • Init(Tire(Flat) Tire(Spare)  At(Flat, Axle) At(Spare, Trunk)) • Goal(At(Spare, Axle)) • Action(Remove(obj, loc), PRECOND:At(obj, loc) EFFECT: At(obj ,loc)  At(obj, Ground)) • Action(PutOn(t. Axle), PRECOND: Tire(t) At(t, Ground) At(Flat, Axle) EFFECT:  At(t, Ground) At(t, Axle))

  7. 2. Types of the Environment • Fully Observable • Partially Observable • Non Observable

  8. Example: Painting a chair and a table • Init(Object(Table) Object(Chair) Can(C1) Can(C2)) • Goal(Color(Chair,c)  Color(Table,c) ) • Action(RemoveLid(can), PRECOND:Can(can) EFFECT: Open(can)) • Action(Paint(x,can), PRECOND: Object(x)  Can(can)  Color(can,c)  Open(can) EFFECT: Color(x,c)) Percept (Color(x,c), PRECOND: Object(x)  InView(x) Percept (Color(can,c), PRECOND: Can(can)  InView(can)  Open (can)

  9. Example: Painting a chair and a table • Init(Object(Table) Object(Chair) Can(C1) Can(C2)  InView(Table)) • Goal(Color(Chair,c)  Color(Table,c) ) • Action(RemoveLid(can), PRECOND:Can(can) EFFECT: Open(can)) • Action(Paint(x,can), PRECOND: Object(x)  Can(can)  Color(can,c)  Open(can) EFFECT: Color(x,c)) • Percept(Color(x,c), PRECOND: Object(x)  InView(x) • Percept (Color(can,c), PRECOND: Can(can)  InView(can)  Open (can)

  10. Example: Painting a chair and a table • Init(Object(Table) Object(Chair) Can(C1) Can(C2)  InView(Table)) • Goal(Color(Chair,c)  Color(Table,c) ) • Action(RemoveLid(can), PRECOND:Can(can) EFFECT: Open(can)) • Action(Paint(x,can), PRECOND: Object(x)  Can(can)  Color(can,c)  Open(can) EFFECT: Color(x,c)) • Percept(Color(x,c), PRECOND: Object(x)  InView(x) • Percept (Color(can,c), PRECOND: Can(can)  InView(can)  Open (can)

  11. Example: Painting a chair and a table • Init(Object(Table) Object(Chair) Can(C1) Can(C2)  InView(Table)) • Goal(Color(Chair,c)  Color(Table,c) ) • Action(RemoveLid(can), PRECOND:Can(can) EFFECT: Open(can)) • Action(Paint(x,can), PRECOND: Object(x)  Can(can)  Color(can,c)  Open(can) EFFECT: Color(x,c)) • Action(LookAt(x), PRECOND:InView(y)  (x  y) EFFECT: InView(x)   InView(y)) ggggggggggg

  12. 3. Methods To deal with different types of the environment • Sensorless (Conformant)Planning • Contingent Planning • Online Replanning

  13. I. Sensorless Planning • Belief state • Belief state for the coloring problem Object(Table) Object(Chair) Can(C1) Can(C2) Color(x,C(x)) bo = Color(x,C(x)) • Open-world assumption

  14. Using belief state to reach the goal • Update belief state b’=RESULT(b,a)=(b-DEL(a))  ADD(a)

  15. Init(Object(Table) Object(Chair) Can(C1) Can(C2)) • Goal(Color(Chair,c)  Color(Table,c) ) • Action(RemoveLid(can), PRECOND:Can(can) EFFECT: Open(can)) • Action(Paint(x,can), PRECOND: Object(x)  Can(can)  Color(can,c)  Open(can) EFFECT: Color(x,c)) Percept (Color(x,c), PRECOND: Object(x)  InView(x) Percept (Color(can,c), PRECOND: Can(can)  InView(can)  Open (can)

  16. Using belief state to reach the goal • Update belief state b’=RESULT(b,a)=(b-DEL(a))  ADD(a) • After applying action RemoveLid(Can1) b1 = Color(x,C(x)) Open(Can1)

  17. Init(Object(Table) Object(Chair) Can(C1) Can(C2)) • Goal(Color(Chair,c)  Color(Table,c) ) • Action(RemoveLid(can), PRECOND:Can(can) EFFECT: Open(can)) • Action(Paint(x,can), PRECOND: Object(x)  Can(can)  Color(can,c)  Open(can) EFFECT: Color(x,c)) Percept (Color(x,c), PRECOND: Object(x)  InView(x) Percept (Color(can,c), PRECOND: Can(can)  InView(can)  Open (can)

  18. Using belief state to reach the goal • Update belief state b’=RESULT(b,a)=(b-DEL(a))  ADD(a) • After applying action RemoveLid(Can1) b1 = Color(x,C(x)) Open(Can1) • After applying action Paint(Chair , Can1) b2 = Color(x,C(x))  Open(Can1)  Color(Chair,C(Can1)) • After applying Paint(Table, Can1) b3= Color(x,C(x))  Open(Can1)  Color(Chair,C(Can1)) Color(Table,C(Can1))

  19. Goal(Color(Chair,c)  Color(Table,c) ) Belief state satisfies the goal.

  20. Problem • Vacuum world Belief state= AtL AtR If we applied action Suck There is a problem: Two different effects!! If AtL, effect: CleanL If AtR, effect:CleanR

  21. Solution • Conditional effect Action(Suck EFFECT: when AtL: CleanL whenAtR: CleanR) b=(AtL CleanL)  (AtR CleanR) • Action(SuckL PRECOND: AtL; EFFECT: CleanL) Action(SuckR PRECOND: AtR; EFFECT: CleanR)

  22. Conservative approach Look for action sequences that keep the belief state as simple as possible • Retain 1-CNF belief state • Some sequences can go outside 1-CNF

  23. Agenda • Recall classical planning • Types of the environment • Methods To deal with different types of the environment • Sensorless (Conformant)Planning • Contingent Planning • Online Replanning • Multiagent Planning • Planning with multiple simultaneous actions • Planning with multiple agents • Summary

  24. II. Contingent Planning: • What’s contingent planning: Contingent planning is the generation of plans with conditional branching based on percepts. It is appropriate for environments with partial observability and/or non-determinism.

  25. After an action and subsequent percept, calculating the new belief state is done in two stages: • Calculating the belief state after the action. • Updating the belief state after perception of the environment. • If a percept P has more than one percept axiom then we have to add the disjunction (OR) of the preconditions. Which will take the belief state out of CNF (and of ors). • We can generate contingent plans with an extension of the AND-OR forward search over belief states.

  26. III. Online Planning • Example: The spot-welding agent in a car plant: • The robot welds the same accurate position in every car that passes down the line, if a car door falls off a car as the robot is trying to apply a spot weld, the robot replaces the welding actuator with a gripper, picks up the door, checks for scratches, reattaches it to the car, email the floor supervisor, switches back to its welding actuator and continues its work. • The robot’s behavior seems purposive. The robot knows what it’s trying to do.

  27. Conditions for Replanning: • Execution monitoring to determine the need for a new plan. • The need for a new plan arises when a contingent planning agent gets tired of planning for every contingency such as the sky might fall on its head.

  28. Needs for Replanning: • If the agent’s model of the world is incorrect. • If the agent’s model of an action have a missing precondition. Example: Opening a can of paints involves using a screwdriver to remove the lid. • If the agent’s model have a missing effect. Example: Painting a chair may get paint on the floor. • If the agent’s model is missing a state variable. Example: How the amount of paint in the can can effect the agent’s actions. • If the agent’s model is lacking provision for exogenous events. Events that are out of the hands of the agent, like someone knocking over the can of paint.

  29. Without monitoring and replanning, the agent’s behavior is as fragile if it relies on absolute correctness of its model. • Levels of monitoring the environment: • Action monitoring: Before the execution of an action, the agent verifies that all the preconditions still hold. • Plan Monitoring: Before the execution of an action, the agent verifies that the remaining plan will still succeed. • Goal Monitoring: Before the execution of an action, the agent checks to see if there is a better set of goals it could be trying to achieve.

  30. Action monitoring Vs. Plan Monitoring: Action monitoring is a simple method of execution monitoring, but it can sometimes lead to less than intelligent behavior. Example: The agent constructs a plan to solve the painting problem by painting both the chair and the table red. Suppose that there is only enough red paint for the chair. With action monitoring, the agent would go ahead and paint the chair red, then notice that it is out of paint and cannot paint the table, at which it would replan a repair, painting the chair and table green. A plan monitoring agent can detect failure whenever the current state is such that the plan no longer works. Thus, it would not waste time painting a chair red.

  31. Does it work? We cannot guarantee that the agent always reaches the goal, Because it could arrive to a dead end state from which there is no repair. For example, the Vacuum cleaner agent may have a faulty model of itself and doesn’t know that its batteries may run out. • For the agent to always reach the goal, we must assume that: • There are no dead ends, the goal is reachable from all states in the environment. • Environment is really non-deterministic.

  32. When actions are not really non-deterministic: • Trouble occurs when actions depend on some precondition the agent doesn’t know about. • Example: The painting agent may not know that the paint can is empty and no amount of retrying to paint would reach the goal. • Two Approaches to solve this problem: • Choosing randomly among the set of possible repair plans, rather than trying the same repair. • Learning: The agent should be able to modify its model of the world to accord with its percepts.

  33. Agenda • Recall classical planning • Types of the environment • Methods To deal with different types of the environment • Sensorless (Conformant)Planning • Contingent Planning • Online Replanning • Multiagent Planning • Planning with multiple simultaneous actions • Planning with multiple agents • Summary

  34. 4. MULTIAGENT PLANNING • When there are multiple agents in the environment, each agent faces a multiagent planning problem. • Between the purely single-agent and truly multiagent cases is a wide spectrum of problems . • Examples: • human who can type and speak at the same time • A fleet of delivery robots in a factory

  35. The multiple bodies act as a single body as long as the relevant sensor information collected by each body can be pooled form a common estimate of the world state that then informs the execution of the overall plan. • When communication constraints make this impossible, we have a decentralized planning problem • Example: Multiple reconnaissance robots covering a wide area

  36. When a single entity is doing the planning, there is really only one goal, which all the bodies necessarily share. • When the bodies are distinct agents that do their own planning, they may still share identical goals • Example: two human tennis players who form a doubles team share the goal of winning the match . • The multibody and multiagent cases are quite different In a multibody robotic doubles team

  37. The clearest case of a multiagent problem, of course is when the agents have different goals. • Example: In tennis, the goals of two opposing teams are in direct conflict. • Some systems are a mixture of centralized and multiagent planning. • Example: a delivery company

  38. The issues involved in multiagent planning can be divided roughly into two sets: • involves issues of representing and planning for multiple simultaneous actions; these issues occur in all settings from multieffectorto multiagent planning. • involves issues of cooperation, coordination, and competition arising in true multiagent settings.

  39. I. Planning with multiple simultaneous actions • For the time being, we will treat the multieffector, multibody, and multiagent settings in the same way. • A correct plan is one that, if executed by the actors, achieves the goal. • We assume perfect synchronization: each action takes the same amount of time and actions at each point in the joint plan are simultaneous.

  40. We begin with the transition model: • In the single -agent setting, there might be b different choices for the action. • In the multiactor setting with n actors, the single action is replaced by a joint action (a1,……,an). • Immediately, we see two problems: • we have to describe the transition model for different joint actions. • we have a joint planning problem with a branching factor of

  41. If the actors have no interaction with one then we can simply solve n separate problems.(Example: n actors each playing a game of solitaire). • The standard approach to loosely coupled problems is to pretend the problems are completely decoupled and then fix up the interactions. • For the transition model, this means writing action schemas as if the actors acted independently.

  42. Problems arise, however, when a plan has both agents hitting the ball at the same time. • Technically, the difficulty is that preconditions constrain the state in which an action can be executed successfully, but do not constrain other actions that might mess it up.

  43. A concurrent action list stating which actions must or must not be executed concurrently. • the Hit action has its stated effect only if no other Hit action by another agent Occurs at the same time.

  44. For some actions, the desired effect is achieved only when another action occurs concurrently. • Example: two agents are needed to carry a cooler full of beverages to the tennis court

  45. Agenda • Recall classical planning • Types of the environment • Methods To deal with different types of the environment • Sensorless (Conformant)Planning • Contingent Planning • Online Replanning • Multiagent Planning • Planning with multiple simultaneous actions • Planning with multiple agents • Summary

  46. II. Planning with multiple agents:Co-operation and Co-ordination Actors(A,B) Init(At(A, LeftBaseline) At(B,RightNet)  Approaching(Ball,RightBaseline)) Partner(A,B)Partner(B,A) Goal(Returned(Ball)(At(a,RightNet) OR At(a,LeftNet)) Action(Hit(actor,Ball), PRECOND: Approaching(Ball,loc)AT(actor,loc) EFFECR: Returned(Ball)) Action(Go(actor,to), PRECOND: AT(actor,loc) to ≠ loc, EFFECT: At(actor,to) ¬At(actor,loc)) Plan1 A: [Go(A, RightBaseline), Hit( A, Ball)] B: [NoOp(B), NoOp(B)] Plan2 A: [Go(A, LeftNet), NoOp(A)] B: [Go(B, RightBaseline), Hit( B, Ball)]

  47. II. Planning with multiple agents:Co-operation and Co-ordination • Initially Init(At(A, LeftBaseline) At(B,RightNet)  Approaching(Ball,RightBaseline)) Partner(A,B)Partner(B,A) Goal(Returned(Ball)(At(a,RightNet) OR At(a,LeftNet))

  48. II. Planning with multiple agents:Co-operation and Co-ordination • Plan 1 Plan1 A: [Go(A, RightBaseline), Hit( A, Ball)] B: [NoOp(B), NoOp(B)]

  49. II. Planning with multiple agents:Co-operation and Co-ordination • Plan 1 Plan1 A: [Go(A, RightBaseline), Hit( A, Ball)] B: [NoOp(B), NoOp(B)]

  50. II. Planning with multiple agents:Co-operation and Co-ordination • Plan 1 Plan1 A: [Go(A, RightBaseline), Hit( A, Ball)] B: [NoOp(B), NoOp(B)] The GOAL

More Related