340 likes | 350 Views
Intelligent Agents. Overview. Agents Rational Agents Measuring rationality Task Environments PEAS Analysis Properties Agent Structure Types of Agents. Agents. An agent is something that acts In this class, we will build software agents Agents that act rationally
E N D
Overview • Agents • Rational Agents • Measuring rationality • Task Environments • PEAS Analysis • Properties • Agent Structure • Types of Agents COSC 159 - Fundamentals of AI
Agents • An agent is something that acts • In this class, we will build software agents • Agents that act rationally • How are agents different from other programs? • Autonomous • Perceptive • Persistent • Adaptable • Assume the goals of other agents COSC 159 - Fundamentals of AI
Agents Agent Percepts Sensors ? Environment Actions Actuators COSC 159 - Fundamentals of AI
Definitions • Percept sequence • History of everything agent has perceive • Agent function • Map from percept sequence to action • Agent program • Implementation of agent function COSC 159 - Fundamentals of AI
Example • Consider a world that has a starving monkey and a banana. Whenever the monkey is in the same location as the banana, the monkey will eat it. After eating the banana, the monkey falls asleep. • We would like to build a simulation for the environment with a software agent representing the monkey. • Consider a world with two locations. COSC 159 - Fundamentals of AI
Example U D COSC 159 - Fundamentals of AI
Example • Assumptions • Monkey can see the bananas and knows its location • Defines percepts: (Location, Contents) • Actions • Up, down, eat, sleep COSC 159 - Fundamentals of AI
Example • Agent function should move monkey to the bananas, eat the bananas, then sleep • One possible agent program is to create a table mapping a percept sequence to appropriate action • Table-driven agent COSC 159 - Fundamentals of AI
Table COSC 159 - Fundamentals of AI
Questions to ponder • Is a table driven agent a good way to implement rational behavior? • Are all sequences of percepts possible in the environment? • What if the monkey didn’t know its location, could you still devise a solution to the problem? How would the percepts change? COSC 159 - Fundamentals of AI
Measuring Rational Behavior • What does it mean for an agent to do the right thing? • The right action is the one causing the agent to be most successful. • A performance measure embodies the criterion for an agent’s success. COSC 159 - Fundamentals of AI
Performance Measures • Simple performance measure for monkey and bananas • The monkey has eaten and fallen asleep. • Suppose you have two monkeys, one that sleeps right after eating and one that wanders around and then falls asleep. Which one is better? Why? COSC 159 - Fundamentals of AI
Performance Measures • Consider more complex environments • What performance measure is appropriate for the economy? • What about for stocks? • How about medical diagnoses? • What about driving a car? • Performance measures are not easy to determine, but you must design one for each environment COSC 159 - Fundamentals of AI
Rationality • Rational behavior at any given time depends on four things • Performance measure • Agent’s prior knowledge • Actions agent can perform • Agent’s percept sequence COSC 159 - Fundamentals of AI
Rational Agents • Definition of a rational agent (R&N, pg. 36) 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. COSC 159 - Fundamentals of AI
Task Environments • Before building an agent, we need to understand the assumptions under which it will execute • Task environment • Performance measure • Environment • Actuators • Sensors COSC 159 - Fundamentals of AI
PEAS Analysis COSC 159 - Fundamentals of AI
Environment Properties • Task environments are unlimited, but we can categorize them among several dimensions • Fully vs. Partially Observable • How much knowledge of the environment is available to the agent • Deterministic vs. stochastic • Next state completely determined by action vs. next state not completely determined • If environment is deterministic except for actions of other agents, it’s strategic COSC 159 - Fundamentals of AI
Environment Properties • Episodic vs. Sequential • Episodic is agent perceiving then performing a single action. Previous episodes don’t matter. • In sequential environments, actions could affect future. • Static vs. dynamic • Does the environment change while the agent is deciding to perform an action? COSC 159 - Fundamentals of AI
Environment Properties • Discrete vs. Continuous • Applies to state of an environment: time; percepts; actions • If finite number of possible states, discrete • Infinite number of possible states, generally continuous. • Single agent vs. multiagent • Number of agents in the environment simultaneously • Competitive vs. cooperative COSC 159 - Fundamentals of AI
Environment Properties COSC 159 - Fundamentals of AI
Structure of Agents • Agents consist of architecture and program • Architecture defines the physical sensors and actuators for the agent • Program implements the agent function mapping percepts to actions • We will focus on designing agent programs, simulating any physical sensors and actuators in software. COSC 159 - Fundamentals of AI
Basic Kinds of Agents • Simple reflex agents • Model-based agents • Goal-based agents • Utility-based agents COSC 159 - Fundamentals of AI
Simple Reflex Agents Agent Percepts Sensors What the world is like now Environment Condition-action rules What action I should do now Actions Actuators COSC 159 - Fundamentals of AI
Simple Reflex Agents • Select actions on the basis of current percept • Agent function implemented with collection of condition-action rules ifbananas-in-the-roomthencommence-eating • Condition action rules are sometimes called situation-action rules, productions, or if-then rules. COSC 159 - Fundamentals of AI
Simple Reflex Agents • These agents are easy to build, but … • Limited intelligence • Require environment to be fully observable • Suppose only percepts for monkey are (Contents), can you write condition-action rules that will work for all possible two location environments? COSC 159 - Fundamentals of AI
Model-based Reflex Agents Percepts Sensors State How the world evolves What the world is like now What my actions do Environment Condition-action rules What action I should do now Actions Actuators Agent COSC 159 - Fundamentals of AI
Model-based Reflex Agents • Incorporates knowledge of “how the world works” • Simulation, mathematics, logic, Bayesian networks, etc. • This is called a model • The monkey can keep track of which locations it has visited, if it uses a model of movement. COSC 159 - Fundamentals of AI
Goal-based Agents Percepts Sensors State How the world evolves What the world is like now What my actions do What will it be like if I do action A Environment What action I should do now Goals Actions Actuators Agent COSC 159 - Fundamentals of AI
Goal-based Agents • A goal describes situations that are desirable • Goal selection can be • easy: if performing a single action results in achieving goal • hard: requires several actions to be taken before goal is achieved • Searching and planning are frequently used with goal-based agents COSC 159 - Fundamentals of AI
Goal-based Agents • Adds flexibility over reflex agents • Can handle change of goals, whereas reflex agents need to have rules modified • Have problems when • Conflicting goals • Several possible ways to achieve a goal COSC 159 - Fundamentals of AI
Utility-based Agents Percepts Sensors State How the world evolves What the world is like now What my actions do What will it be like if I do action A Environment Utility How happy will I be? What action I should do now Actions Actuators Agent COSC 159 - Fundamentals of AI
Utility-based Agents • Rather than simple binary measure of “happy” and “unhappy”, include a measure of happiness called utility • A utility function maps a state onto a real number • Embodies tradeoffs for conflicting goals • safe vs. speedy driving • Embodies measures of several goals, none of which are guaranteed to be achieved • I’m hungry. Should I play the lottery or search for food in the desert? COSC 159 - Fundamentals of AI