Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Artificial Intelligence CS 165A Thursday, October 4, 2007  Intelligent agents (Ch. 2)  Blind search (Ch. 3) 1.

Similar presentations


Presentation on theme: "1 Artificial Intelligence CS 165A Thursday, October 4, 2007  Intelligent agents (Ch. 2)  Blind search (Ch. 3) 1."— Presentation transcript:

1 1 Artificial Intelligence CS 165A Thursday, October 4, 2007  Intelligent agents (Ch. 2)  Blind search (Ch. 3) 1

2 2 Notes New room!

3 3 Review What is an agent? –An entity capable of combining cognition, perception and action in behaving autonomously, purposively and flexibly in some environment What does an agent do? –An agent perceives its environment, reasons about its goals, and acts upon the environment What does PEAS stand for (description of an agent)? –Performance measure, Environment, Actuators, Sensors What are we about to do right now?

4 4 Thursday Quiz #1 Write your name, your perm #, and the date at the top of the page 1.Humans often solve NP-complete problems in times much shorter than the complexity limits. Does McCarthy consider this evidence that computers are intrinsically incapable of doing what people do? 2.Why or why not?

5 5 Generic Agent Program Implementing f : P*  A …or… f (P*) = A –Lookup table? –Learning? Knowledge, past percepts, past actions Add percept to percepts LUT [percepts, table] NOP Table-Driven-Agent e.g.,

6 6 Basic types of agent programs Simple reflex agent Model-based reflex agent Goal-based agent Utility-based agent Learning agent

7 7 Simple Reflex Agent Input/output associations Condition-action rule: “If-then” rule (production rule) –If condition then action (if in a certain state, do this) –If antecedent then consequent

8 8 Simple Reflex Agent Simple state-based agent – Classify the current percept into a known state, then apply the rule for that state

9 9 Model-Based Reflex Agent Internal state – keeps track of the world, models the world

10 10 Model-Based Reflex Agent State-based agent – Given the current state, classify the current percept into a known state, then apply the rule for that state

11 11 Goal-Based Agent Goal: immediate, or long sequence of actions? –Search and planning – finding action sequences that achieve the agent’s goals

12 12 Utility-Based Agent “There are many ways to skin a cat” Utility function: Specifies degree of usefulness (happiness) –Maps a state onto a real number

13 13 Learning Agent

14 14 Environments Properties of environments –Fully vs. partially observable –Deterministic vs. stochastic –Episodic vs. sequential –Friendly vs. hostile –Static vs. dynamic –Discrete vs. continuous –Single agent vs. multiagent The environment types largely determine the agent design The real world is inaccessible, stochastic, nonepisodic, hostile, dynamic, and continuous –Bummer…

15 15 Problem Solving and Search Chapter 3

16 16 Problem Solving Agents Task: Find a sequence of actions that leads to desirable (goal) states –Must define problem and solution Finding a solution is typically a search process in the problem space –Solution = A path through the state space from the initial state to a goal state –Optimal search find the least-cost solution Search algorithm –Input: Problem statement (incl. goal) –Output: Sequence of actions that leads to a solution Formulate, search, execute (action)

17 17 Search Strategies Uninformed (blind) search (Chap. 3) –Can only distinguish goal state from non-goal state Informed (heuristic) search (Chap. 4) –Can evaluate states

18 18 Problem Formulation and Search Problem formulation –State-space description  S: Possible states  S 0 : Initial state of the agent  S G : Goal state(s) –Or equivalently, a goal test G(S)  O: Operators O: {S} => {S} –Describes the possible actions of the agent  g: Path cost function, assigns a cost to a path/action At any given time, which possible action O i is best? –Depends on the goal, the path cost function, the future sequence of actions…. Agent’s strategy: Formulate, Search, and Execute –This is offline (or batch) problem solving

19 19 Typical assumptions for simple PS agent Environment is observable Environment is static Environment is discrete Environment is deterministic

20 20 State-Space Diagrams State-space description can be represented by a state- space diagram, which shows –States (incl. initial and goal) –Operators/actions (state transitions) –Path costs

21 21 Example: Romania You’re in Arad, Romania, and you need to get to Bucharest as quickly as possible to catch your flight. Formulate problem –States: Various cities –Operators: Drive between cities Formulate goal –Be in Bucharest before flight leaves Find solution –Actual sequence of cities from Arad to Bucharest –Minimize driving distance/time

22 22 Romania (cont.)

23 23 Romania (cont.) Problem description {S} – cities (c i ) S 0 – Arad S G – Bucharest –G(S) – Is the current state (S) Bucharest? {O}: { c i  c j, for some i and j } g ij –Driving distance between c i and c j ? –Time to drive from c i to c j ? –1?

24 24 Possible paths Sibiu Oradea Zerind Bucharest PitestiBucharest FagarasR. Vilcea Sibiu DobretaMehadiaLugoj Timisoara Arad Which is best?

25 25 Branching Factor If there are N possible choices at each state, then the branching factor is N If it takes M steps (state transitions) to get to the goal state, then it may be the case that O(N M ) states have to be checked –N = 3, M = 5  N M = 243 –N = 5, M = 10  N M = 9,765,625 –N = 8, M = 15  N M = 35,184,372,088,832 Ouch…. Combinatorial explosion!

26 26 Abstraction The real world is highly complex! –The state space must be abstracted for problem-solving  Simplify and aggregate –Can’t represent all the details Choosing a good abstraction –Remove as much detail as possible while retaining validity

27 27 Example Problem: 8-Puzzle States: Various configurations of the puzzle Operators: Movements of the blank Goal test: State matches goal state Path cost: Each move costs 1 How many states are there? 9! = 362,880

28 28 One way to represent the state Action State ====== ===== 091150500 > 086898972 ^ 110781012 ^ 110826876 > 110826300 V 110590428 V 024615084 < 215933844 ^ 249368700 < 249403692 V 248872980 > 219112284 ^ 247770732 ^ 247823148 < 247823172 V 247822444 > 247775788 > 247670812 ^ 247906684 < 247906900 V 247893796 Goal State: 1*9^0 + 2*9^1 + 3*9^2 + 8*9^3 + 0*9^4 + 4*9^5 + 7*9^6 + 6*9^7 + 5*9^8 = 247893796 Start State: 5*9^0 + 4*9^1 + 0*9^2 + 6*9^3 + 1*9^4 + 8*9^5 + 7*9^6 + 3*9^7 + 2*9^8 = 104645804

29 29 8-Puzzle is hard (by definition)! Optimal solution of the N-puzzle family of problems is NP-complete –Exponential increase in computation with N –Uninformed search will do very poorly Ditto for the Traveling Salesman Problem (TSP) –Start and end in Bucharest, visit every city at least once –Find the shortest tour Ditto for lots of interesting problems!

30 30 Example: MU-Puzzle States: Strings comprising the letters M, I, and U Initial state: MI Goal state: MU Operators: (where x stands for any string, including the null string) 1. x I  x IU“Append U” 2. M x  M x x“Replicate x” 3. xI I Ix  xUx“Replace with U” 4. xUUx  xx“Drop UU” Each rule describes the whole string, not a subset Path cost: one per step Try it –Can you draw the state-space diagram? –Are you guaranteed a solution? M I  M I I  M I I I I  M U I  M U I U  M U I U U I U  M U I U U I U U I U U I U  M U I I I I U  M U U I U  M I U  … M I  M I I  M I I I I  M U I  M U I U  M U I U U I U  M U I U U I U U I U U I U  M U I I I I U  M U U I U  M I U  …

31 31 Clarification of the MU-puzzle rules: 1.If the string ends with I you may add U; for example, MI becomes MIU 2.If the string is Mx then you may create Mxx; for example, MI becomes MII; MIU becomes MIUIU 3.If the string contains III you may replace those three characters with U 4.If the string contains UU you may eliminate both characters

32 32 Example: The Vacuum World Simplified world: 2 grids States: Location of vacuum, dirt in grids Operators: Move left, move right, suck dirt Goal test: Grids free of dirt Path cost: Each action costs 1

33 33 The Vacuum World (cont.) How to reach the goal? –If starting at top left state: S, R, S –If starting at middle far right state: L, S What if agent doesn’t know its initial state? –You probably need to redraw the state diagram! –Represent initial uncertainty as one “meta-state”  For example…


Download ppt "1 Artificial Intelligence CS 165A Thursday, October 4, 2007  Intelligent agents (Ch. 2)  Blind search (Ch. 3) 1."

Similar presentations


Ads by Google