Download as pdf or txt
Download as pdf or txt
You are on page 1of 30

Intelligent Agents

AIMA, Chapter 2
Outline
 Brief Review
 Agents and environments
 Rationality
 PEAS (Performance measure, Environment,
Actuators, Sensors)
 Environment types
 Agent types

CIS 391 - Intro to AI - Spring 2011 2


Review I: AI as Acting Rationally

Thinking humanly Thinking rationally


Acting humanly Acting rationally

 Rational behavior: doing whatever is expected to


maximize goal achievement, given the available
information

 This course is about effective programming


techniques for designing rational agents

CIS 391 - Intro to AI - Spring 2011 3


Review II: Rational agents
 An agent is an entity that perceives and acts

 Abstractly, an agent is a function from percept histories to


actions:
[f: P*  A]

 For any given class of environments and tasks, we seek the


agent (or class of agents) with the best performance

CIS 391 - Intro to AI - Spring 2011 4


Alternate approaches to AI
 Symbolic representations of the world
• Relations between entities
—―Lyle’s bicycle is red‖
– (isa B3241 bicycle) (color B3231 red) (owns B3241 P119)
– (isa P119 person) (name P119 ―Lyle‖)
• Explicit logical models
• Logical inference, Search
• Chess, Sudoko, computer games, …
 Instance-based and statistical models
• Prediction by look-up or by weighted combinations
—P(y=bicycle) = c0 + c1 x1 +c2 x2 + c3 x3 + …
• Implicit probabilistic models
• Machine vision, document retrieval, speech recognition, …

CIS 391 - Intro to AI - Spring 2011 5


Course Overview – First Half
Module 0: Introduction
• Intelligent Agents
• Python Programming (Week long introduction)
Module 1: Search Strategies
• Uninformed & Informed Search
• Constraint Satisfaction (Sudoku Solver)
• Adversarial Search (Game Playing)
• Homework: Build a solver for any Sudoku problem
• Final Project: Build a bot that competes against other game
bots to play a simple board game (Kingdoms)

CIS 391 - Intro to AI - Spring 2011 6


Course Overview – Second Half
Module 2: Machine Learning and Natural Language
Processing
• Introduction to Probability and Bayesian Networks
• Naive Bayes (Spam Filtering)
• Hidden Markov Models & Part of Speech Tagging
• Decision Trees
• Perceptrons and Support Vector Machines
• Homework: Build a spam filter using Naïve Bayes machine
learning

CIS 391 - Intro to AI - Spring 2011 7


Course Overview – Second Half (cont.)

Module 3: Knowledge Representation and Logic


• Logical Agents (Automated Wumpus adventurer)
• Topics in Knowledge Representation
• Homework: Build an agent that plays Hunt the Wumpus
using propositional logic theorem proving

CIS 391 - Intro to AI - Spring 2011 8


Agents

 An agent is anything that can be viewed as


• perceiving its environment through sensors and
• acting upon that environment through actuators

 Human agent:
• Sensors: eyes, ears, ...
• Actuators: hands, legs, mouth, …

 Robotic agent:
• Sensors: cameras and infrared range finders
• Actuators: various motors

 Agents include humans, robots, softbots, thermostats, …

CIS 391 - Intro to AI - Spring 2011 9


Agents and environments

An agent is specified by an agent function f that


maps sequences of percepts Y to actions a from a
set A:
Y={y0, y1, … , yt}
A={a0, a1, … , ak}

CIS 391 - Intro to AI - Spring 2011 10


Agent function & program
 The agent program runs on the physical
architecture to produce f
• agent = architecture + program
 “Easy” solution: table that maps every possible
sequence Y to an action a
• One small problem: exponential in length of Y

CIS 391 - Intro to AI - Spring 2011 11


Example: A Vacuum-cleaner agent

A B

 Percepts: location and contents, e.g., (A,dirty)


• (Idealization: locations are discrete)
 Actions: move, clean, do nothing:
LEFT, RIGHT SUCK NOP

CIS 391 - Intro to AI - Spring 2011 12


Vacuum-cleaner world: agent function

CIS 391 - Intro to AI - Spring 2011 13


Rational agents II
 Rational Agent: For each possible percept
sequence, a rational agent should select an
action that is expected to maximize its
performance measure.
 Performance measure: An objective criterion for
success of an agent's behavior, given the
evidence provided by the percept sequence.
 A performance measure for a vacuum-cleaner
agent might include one or more of:
• +1 point for each clean square in time T
• +1 point for clean square, -1 for each move
• -1000 for more than k dirty squares

CIS 391 - Intro to AI - Spring 2011 14


Rationality is not omniscience
 Ideal agent: maximizes actual performance, but
needs to be omniscient.
• Usually impossible…..
— But consider tic-tac-toe agent…
• Rationality  Success

 Agents can perform actions in order to modify


future percepts so as to obtain useful information
(information gathering, exploration)

 An agent is autonomous if its behavior is


determined by its own experience (with ability to
learn and adapt)

CIS 391 - Intro to AI - Spring 2011 15


Task environment
 To design a rational agent we need to specify a
task environment
• a problem specification for which the agent is a solution

 PEAS: to specify a task environment


• Performance measure
• Environment
• Actuators
• Sensors

CIS 391 - Intro to AI - Spring 2011 16


PEAS: Specifying an automated taxi driver

Performance measure:
• ?
Environment:
• ?
Actuators:
• ?
Sensors:
• ?

CIS 391 - Intro to AI - Spring 2011 17


PEAS: Specifying an automated taxi driver

Performance measure:
• safe, fast, legal, comfortable, maximize profits
Environment:
• ?
Actuators:
• ?
Sensors:
• ?

CIS 391 - Intro to AI - Spring 2011 18


PEAS: Specifying an automated taxi driver

Performance measure:
• safe, fast, legal, comfortable, maximize profits
Environment:
• roads, other traffic, pedestrians, customers
Actuators:
• ?
Sensors:
• ?

CIS 391 - Intro to AI - Spring 2011 19


PEAS: Specifying an automated taxi driver

Performance measure:
• safe, fast, legal, comfortable, maximize profits
Environment:
• roads, other traffic, pedestrians, customers
Actuators:
• steering, accelerator, brake, signal, horn
Sensors:
• ?

CIS 391 - Intro to AI - Spring 2011 20


PEAS: Specifying an automated taxi driver

Performance measure:
• safe, fast, legal, comfortable, maximize profits
Environment:
• roads, other traffic, pedestrians, customers
Actuators:
• steering, accelerator, brake, signal, horn
Sensors:
• cameras, sonar, speedometer, GPS

CIS 391 - Intro to AI - Spring 2011 21


PEAS: Another example
 Agent: Medical diagnosis system

 Performance measure: Healthy patient, minimize


costs, lawsuits
 Environment: Patient, hospital, staff
 Actuators: Screen display (form including:
questions, tests, diagnoses, treatments, referrals)
 Sensors: Keyboard (entry of symptoms, findings,
patient's answers)

CIS 391 - Intro to AI - Spring 2011 22


Environment types: Definitions I
 Fully observable (vs. partially observable): An agent's
sensors give it access to the complete state of the
environment at each point in time.

 Deterministic (vs. stochastic): The next state of the


environment is completely determined by the current state
and the action executed by the agent.
• (If the environment is deterministic except for the actions of other
agents, then the environment is strategic)

 Episodic (vs. sequential): The agent's experience is


divided into atomic "episodes" during which the agent
perceives and then performs a single action, and the choice
of action in each episode depends only on the episode
itself.

CIS 391 - Intro to AI - Spring 2011 23


Environment types: Definitions II
 Static (vs. dynamic): The environment is unchanged while
an agent is deliberating.
• The environment is semidynamic if the environment itself does not
change with the passage of time but the agent's performance score
does.

 Discrete (vs. continuous): A limited number of distinct,


clearly defined percepts and actions.

 Single agent (vs. multiagent): An agent operating by itself in


an environment.
(See examples in AIM,
however I don’t agree with some of the judgments)

CIS 391 - Intro to AI - Spring 2011 24


Agent types
 Goal of AI:
• given a PEAS task environment,
• construct agent function f,
• design an agent program that implements f on a
particular architecture
 Four basic agent types in order of increasing
generality:
• Simple reflex
• Model-based reflex
• Goal-based
• Utility-based

CIS 391 - Intro to AI - Spring 2011 25


Simple reflex agent

function REFLEX_VACUUM_AGENT( percept )


returns an action

(location,status) = UPDATE_STATE( percept )

if status = DIRTY then return SUCK;


else if location = A then return RIGHT;
else if location = B then return LEFT;

CIS 391 - Intro to AI - Spring 2011 26


Model-based reflex agents
New

CIS 391 - Intro to AI - Spring 2011 27


Goal-based agents

New

CIS 391 - Intro to AI - Spring 2011 28


Utility-based agents

New

CIS 391 - Intro to AI - Spring 2011 29


Learning agents incorporate others

Any
other
agent!

CIS 391 - Intro to AI - Spring 2011 30

You might also like