chapters 4 5 non classical and chapters 4 5 non classical
play

CHAPTERS 45: NON-CLASSICAL AND CHAPTERS 45: NON-CLASSICAL AND - PowerPoint PPT Presentation

DIT411/TIN175, Artificial Intelligence Chapters 45: Non-classical and adversarial search CHAPTERS 45: NON-CLASSICAL AND CHAPTERS 45: NON-CLASSICAL AND ADVERSARIAL SEARCH ADVERSARIAL SEARCH DIT411/TIN175, Artificial Intelligence Peter


  1. DIT411/TIN175, Artificial Intelligence Chapters 4–5: Non-classical and adversarial search CHAPTERS 4–5: NON-CLASSICAL AND CHAPTERS 4–5: NON-CLASSICAL AND ADVERSARIAL SEARCH ADVERSARIAL SEARCH DIT411/TIN175, Artificial Intelligence Peter Ljunglöf 2 February, 2018 1

  2. TABLE OF CONTENTS TABLE OF CONTENTS Repetition Uninformed search (R&N 3.4) Heuristic search (R&N 3.5–3.6) Local search (R&N 4.1) Non-classical search Nondeterministic search (R&N 4.3) Partial observations (R&N 4.4) Adversarial search Types of games (R&N 5.1) Minimax search (R&N 5.2–5.3) Imperfect decisions (R&N 5.4–5.4.2) Stochastic games (R&N 5.5) 2

  3. REPETITION REPETITION UNINFORMED SEARCH (R&N 3.4) UNINFORMED SEARCH (R&N 3.4) Search problems, graphs, states, arcs, goal test, generic search algorithm, tree search, graph search, depth-first search, breadth-first search, uniform cost search, iterative deepending, bidirectional search, … HEURISTIC SEARCH (R&N 3.5–3.6) HEURISTIC SEARCH (R&N 3.5–3.6) Greedy best-first search, A* search, heuristics, admissibility, consistency, dominating heuristics, … LOCAL SEARCH (R&N 4.1) LOCAL SEARCH (R&N 4.1) Hill climbing / gradient descent, random moves, random restarts, beam search, simulated annealing, … 3

  4. NON-CLASSICAL SEARCH NON-CLASSICAL SEARCH NONDETERMINISTIC SEARCH (R&N 4.3) NONDETERMINISTIC SEARCH (R&N 4.3) PARTIAL OBSERVATIONS (R&N 4.4) PARTIAL OBSERVATIONS (R&N 4.4) 4

  5. NONDETERMINISTIC SEARCH (R&N 4.3) NONDETERMINISTIC SEARCH (R&N 4.3) Contingency plan / strategy And-or search trees (not in the written exam) 5

  6. AN ERRATIC VACUUM CLEANER AN ERRATIC VACUUM CLEANER The eight possible states of the vacuum world; states 7 and 8 are goal states. There are three actions: Le�, Right, Suck . Assume that the Suck action works as follows: if the square is dirty, it is cleaned but sometimes also the adjacent square is if the square is clean, the vacuum cleaner sometimes deposists dirt 6

  7. NONDETERMINISTIC OUTCOMES, CONTINGENCY PLANS NONDETERMINISTIC OUTCOMES, CONTINGENCY PLANS Assume that the Suck action is nondeterministic: if the square is dirty, it is cleaned but sometimes also the adjacent square is if the square is clean, the vacuum cleaner sometimes deposists dirt Now we need a more general result function: instead of returning a single state, it returns a set of possible outcome states e.g., and ������� ( ���� , 1) = {5, 7} ������� ( ���� , 5) = {1, 5} We also need to generalise the notion of a solution : instead of a single sequence (path) from the start to the goal, we need a strategy (or a contingency plan ) i.e., we need if-then-else constructs this is a possible solution from state 1: [ Suck , if State =5 then [ Right , Suck ] else []] 7

  8. HOW TO FIND CONTINGENCY PLANS HOW TO FIND CONTINGENCY PLANS (will not be in the written examination) We need a new kind of nodes in the search tree: and nodes : these are used whenever an action is nondeterministic normal nodes are called or nodes : they are used when we have several possible actions in a state A solution for an and-or search problem is a subtree that: has a goal node at every leaf specifies exactly one action at each of its or node includes every branch at each of its and node 8

  9. A SOLUTION TO THE ERRATIC VACUUM CLEANER A SOLUTION TO THE ERRATIC VACUUM CLEANER (will not be in the written examination) The solution subtree is shown in bold, and corresponds to the plan: [ Suck , if State =5 then [ Right , Suck ] else []] 9

  10. AN ALGORITHM FOR FINDING A CONTINGENCY PLAN AN ALGORITHM FOR FINDING A CONTINGENCY PLAN (will not be in the written examination) This algorithm does a depth-first search in the and-or tree, so it is not guaranteed to find the best or shortest plan: function AndOrGraphSearch( problem ): return OrSearch( problem .InitialState, problem , []) function OrSearch( state , problem , path ): if problem .GoalTest( state ) then return [] if state is on path then return failure for each action in problem .Actions( state ): plan := AndSearch( problem .Results( state , action ), problem , [ state ] ++ path ) if plan ≠ failure then return [ action ] ++ plan return failure function AndSearch( states , problem , path ): for each in states : s i := OrSearch( , problem , path ) plan i s i if = failure then return failure plan i return [if then else if then else … if then ] s 1 plan 1 s 2 plan 2 s n plan n 10

  11. WHILE LOOPS IN CONTINGENCY PLANS WHILE LOOPS IN CONTINGENCY PLANS (will not be in the written examination) If the search graph contains cycles, if-then-else is not enough in a contingency plan: we need while loops instead In the slippery vacuum world above, the cleaner don’t always move when told: the solution above translates to [ Suck , while State =5 do Right , Suck ] 11

  12. PARTIAL OBSERVATIONS (R&N 4.4) PARTIAL OBSERVATIONS (R&N 4.4) Belief states: goal test, transitions, … Sensor-less (conformant) problems Partially observable problems 12

  13. OBSERVABILITY VS DETERMINISM OBSERVABILITY VS DETERMINISM A problem is nondeterministic if there are several possible outcomes of an action deterministic — nondeterministic (chance) It is partially observable if the agent cannot tell exactly which state it is in fully observable (perfect info.) — partially observable (imperfect info.) A problem can be either nondeterministic, or partially observable, or both: 13

  14. BELIEF STATES BELIEF STATES Instead of searching in a graph of states, we use belief states A belief state is a set of states In a sensor-less (or conformant) problem, the agent has no information at all The initial belief state is the set of all problem states e.g., for the vacuum world the initial state is {1,2,3,4,5,6,7,8} The goal test has to check that all members in the belief state is a goal e.g., for the vacuum world, the following are goal states: {7}, {8}, and {7,8} The result of performing an action is the union of all possible results i.e., for each ������� ( b , a ) = { ������ ( s , a ) s ∈ b } if the problem is also nondeterministic: for each ������� ( b , a ) = ⋃ { ������� ( s , a ) s ∈ b } 14

  15. PREDICTING BELIEF STATES IN THE VACUUM WORLD PREDICTING BELIEF STATES IN THE VACUUM WORLD (a) Predicting the next belief state for the sensorless vacuum world with a deterministic action, Right . (b) Prediction for the same belief state and action in the nondeterministic slippery version of the sensorless vacuum world. 15

  16. THE DETERMINISTIC SENSORLESS VACUUM WORLD THE DETERMINISTIC SENSORLESS VACUUM WORLD 16

  17. PARTIAL OBSERVATIONS: STATE TRANSITIONS PARTIAL OBSERVATIONS: STATE TRANSITIONS With partial observations, we can think of belief state transitions in three stages: Prediction , the same as for sensorless problems: for each b ′ = ������� ( b , a ) = { ������ ( s , a ) s ∈ b } Observation prediction , determines the percepts that can be observed: for each b ′ b ′ ���������������� ( ) = { ������� ( s ) s ∈ } Update , filters the predicted states according to the percepts: for each such that b ′ s ∈ b ′ ������ ( , o ) = { s o = ������� ( s )} Belief state transitions: for each b ′ b ′ ������� ( b , a ) = { ������ ( , o ) o ∈ ���������������� ( )} where b ′ = ������� ( b , a ) 17

  18. TRANSITIONS IN PARTIALLY OBSERVABLE VACUUM WORLDS TRANSITIONS IN PARTIALLY OBSERVABLE VACUUM WORLDS The percepts return the current position and the dirtyness of that square. The deterministic world: Right always succeeds. The slippery world: Right sometimes fails. 18

  19. EXAMPLE: ROBOT LOCALISATION EXAMPLE: ROBOT LOCALISATION The percepts return whether there is a wall in each of the directions. Possible initial positions of the robot, a�er E1 = North, South, West . A�er moving right and observing E2 = North, South , there’s only one possible position le�. 19

  20. ADVERSARIAL SEARCH ADVERSARIAL SEARCH TYPES OF GAMES (R&N 5.1) TYPES OF GAMES (R&N 5.1) MINIMAX SEARCH (R&N 5.2–5.3) MINIMAX SEARCH (R&N 5.2–5.3) IMPERFECT DECISIONS (R&N 5.4–5.4.2) IMPERFECT DECISIONS (R&N 5.4–5.4.2) STOCHASTIC GAMES (R&N 5.5) STOCHASTIC GAMES (R&N 5.5) 20

  21. TYPES OF GAMES (R&N 5.1) TYPES OF GAMES (R&N 5.1) cooperative, competetive, zero-sum games game trees, ply/plies, utility functions 21

  22. MULTIPLE AGENTS MULTIPLE AGENTS Let’s consider problems with multiple agents, where: the agents select actions autonomously each agent has its own information state they can have different information (even conflicting) the outcome depends on the actions of all agents each agent has its own utility function (that depends on the total outcome) 22

Recommend


More recommend