=== p1 === Introduction to Artificial Intelligence Chapter 2 Intelligent Agents Wei-Ta Chu (朱威達) 1 === p2 === • An agent is anything that can be viewed as perceiving its environment through sensors and acting upon that environment through actuators (促動 器). Agents and Environments 2 === p3 === • The term percept refers to the agent’s perceptual inputs at any given instant. • An agent’s behavior is described by the agent function that maps any given percept sequence to an action. • A very simple example—the vacuum-cleaner world Agents and Environments 3 === p4 === • It can choose to move left, move right, suck up the dirt, or do nothing. One very simple agent function: if the current square is dirty, then suck; otherwise, move to the other square. • What is the right way to fill out the table? What makes an agent good or bad, intelligent or stupid? Agents and Environments 4 === p5 === • A rational agent is one that does the right thing. • Right thing: The agent’s actions causes the environment to go through a sequence of states. If the sequence is desirable, then the agent has performed well. This notion of desirability is captured by a performance measure that evaluates any given sequence of environment states. • It is better to design performance measures according to what one actually wants in the environment, rather than according to how one thinks the agent should behave. The Concept of Rationality 5 === p6 === • Definition of a rational agent • For each possible percept sequence, a rational agent should select an action that is expected to maximize its performance measure, given the evidence provided by the percept sequence and whatever built-in knowledge the agent has. • Consider the simple vacuum-cleaner agent. Is this a rational agent? That depends! • Performance measure: the amount of dirt being cleaned up • Performance measure: a clean floor Rationality 6 === p7 === • Rationality maximizes expected performance, while perfection maximizes actual performance. • Our definition of rationality does not require omniscience (全知), because the rational choice depends only on the percept sequence to date. • Our definition requires a rational agent not only to gather information but also to learn as much as possible from what it perceives. Omniscience, Learning, and Autonomy 7 === p8 === • A rational agent should be autonomous—it should learn what it can to compensate for partial or incorrect prior knowledge. • A vacuum-cleaning agent that learns to foresee where and when additional dirt will appear will do better than one that does not. • The incorporation of learning allows one to design a single rational agent that will succeed in a vast variety of environments. Omniscience, Learning, and Autonomy 8 === p9 === • Task environment: we have to specify the performance measure, the environment, and the agent’s actuators and sensors. • PEAS (Performance, Environment, Actuators, Sensors) Task Environments 9 === p10 === Task Environments 10 [IMAGE-ONLY] === p11 === • Fully observable vs. partially observable • Fully observable: if the sensors detect all aspects that are relevant to the choice of action • Single agent vs. multiagent • The key distinction is whether B’s behavior is best described as maximizing a performance measure whose value depends on agent A’s behavior. • Chess is a competitive multiagent environment Properties of Task Environments 11 === p12 === • Deterministic vs. stochastic • If the next state of the environment is completely determined by the current state and the action executed by the agent, then we say the environment is deterministic; otherwise, it is stochastic. • Taxi driving is clearly stochastic • “Stochastic” generally implies that uncertainty about outcomes is quantified in terms of probabilities Properties of Task Environments 12 === p13 === • Episodic (情節不連貫的) vs. sequential • Episodic: the next episode does not depend on the actions taken in previous episodes. • Chess and taxi driving are sequential • Static vs. dynamic • If the environment can change while an agent is deliberating (思考), then we say the environment is dynamic for that agent. • Taxi driving is clearly dynamic: the other cars and the taxi itself keep moving while the driving algorithm dithers (猶豫) about what to do next. Properties of Task Environments 13 === p14 === • Discrete vs. continuous • The chess environment has a finite number of distinct states. Chess also has a discrete set of percepts and actions. Taxi driving is a continuous- state and continuous-time problem. • Known vs. unknown • The agent’s (or designer’s) state of knowledge about the “laws of physics” of the environment. Properties of Task Environments 14 === p15 === Properties of Task Environments 15 [IMAGE-ONLY] === p16 === • The job of AI is to design an agent program that implements the agent function— the mapping from percepts to actions. • We assume this program will run on some sort of computing device with physical sensors and actuators—we call this the architecture. • agent = architecture + program The Structure of Agents 16 === p17 === • A trivial agent program • The table-driven approach to agent construction is doomed to failure – tables could be too huge Agent Programs 17 === p18 === • Select actions on the basis of the current percept, ignoring the rest of the percept history. Simple Reflex Agents 18 === p19 === Simple Reflex Agents 19 • Condition-action rule • Work only if the correct decision can be made on the basis of only the current percept—that is, only if the environment is fully observable. === p20 === • Handle partial observability: the agent keeps track of the part of the world it can’t see now. The agent should maintain some sort of internal state that depends on the percept history. Model-based Reflex Agents 20 === p21 === Model-based Reflex Agents 21 [IMAGE-ONLY] === p22 === • Knowing the current state of environment is not always enough to decide what to do. The agent needs some sort of goal information that describes situations that are desirable. • The goal-based agent’s behavior can easily be changed to go to a different destination, simply by specifying that destination as the goal. • Decision making different from condition-action rules • Consideration of the future – both “What will happen if I do such-and- such?” and “Will that make me happy?” Goal-based Reflex Agents 22 === p23 === Goal-based Reflex Agents 23 [IMAGE-ONLY] === p24 === • Goals alone are not enough to generate high-quality behavior in most environments. Sometimes, goals are inadequate but a utility-based agent can still make rational decisions. • When there are conflicting goals, only some of which can be achieved • When there are several goals that the agent can aim for • A rational utility-based agent chooses the action that maximizes the expected utility of the action outcomes. Utility-based Reflex Agents 24 === p25 === • Utility-based agent programs handle the uncertainty inherent in stochastic or partially observable environments. Utility-based Reflex Agents 25 === p26 === • Learning element is responsible for making improvements, and the performance element is responsible for selecting external actions. • The learning element uses feedback from the critic on how the agent is doing and determines how the performance component should be modified to do better in the future. Learning Agents 26