Professional Documents
Culture Documents
c
Artificial Intelligence, spring 2013, Peter Ljunglöf; based on AIMA Slides
Stuart Russel and Peter Norvig, 2004 Chapter 2, Sections 1–4 1
Outline
♦ Agents and environments
♦ Rationality
♦ PEAS (Performance measure, Environment, Actuators, Sensors)
♦ Environment types
♦ Agent types
c
Artificial Intelligence, spring 2013, Peter Ljunglöf; based on AIMA Slides
Stuart Russel and Peter Norvig, 2004 Chapter 2, Sections 1–4 2
Agents and environments
sensors
percepts
?
environment
agent
actions
actuators
c
Artificial Intelligence, spring 2013, Peter Ljunglöf; based on AIMA Slides
Stuart Russel and Peter Norvig, 2004 Chapter 2, Sections 1–4 3
Vacuum-cleaner world
A B
c
Artificial Intelligence, spring 2013, Peter Ljunglöf; based on AIMA Slides
Stuart Russel and Peter Norvig, 2004 Chapter 2, Sections 1–4 4
A vacuum-cleaner agent
A simple agent function is:
If the current square is dirty, then suck;
otherwise, move to the other square.
. . . or as pseudo-code:
c
Artificial Intelligence, spring 2013, Peter Ljunglöf; based on AIMA Slides
Stuart Russel and Peter Norvig, 2004 Chapter 2, Sections 1–4 5
Rationality
Fixed performance measure evaluates the environment sequence
– one point per square cleaned up in time T ?
– one point per clean square per time step, minus one per move?
– penalize for > k dirty squares?
A rational agent chooses any action that
– maximizes the expected value of the performance measure
– given the percept sequence to date
Rational 6= omniscient
– percepts may not supply all relevant information
Rational 6= clairvoyant
– action outcomes may not be as expected
Hence, rational 6= successful
Rational ⇒ exploration, learning, autonomy
c
Artificial Intelligence, spring 2013, Peter Ljunglöf; based on AIMA Slides
Stuart Russel and Peter Norvig, 2004 Chapter 2, Sections 1–4 6
PEAS
To design a rational agent, we must specify the task environment,
which consists of the following four things:
Performance measure??
Environment??
Actuators??
Sensors??
Examples of agents:
– Automated taxi,
– Internet shopping agent,
– Boardgames
c
Artificial Intelligence, spring 2013, Peter Ljunglöf; based on AIMA Slides
Stuart Russel and Peter Norvig, 2004 Chapter 2, Sections 1–4 7
Automated taxi
c
Artificial Intelligence, spring 2013, Peter Ljunglöf; based on AIMA Slides
Stuart Russel and Peter Norvig, 2004 Chapter 2, Sections 1–4 8
Internet shopping agent
c
Artificial Intelligence, spring 2013, Peter Ljunglöf; based on AIMA Slides
Stuart Russel and Peter Norvig, 2004 Chapter 2, Sections 1–4 9
Question-answering system
c
Artificial Intelligence, spring 2013, Peter Ljunglöf; based on AIMA Slides
Stuart Russel and Peter Norvig, 2004 Chapter 2, Sections 1–4 10
Question-answering system: Jeopardy!
c
Artificial Intelligence, spring 2013, Peter Ljunglöf; based on AIMA Slides
Stuart Russel and Peter Norvig, 2004 Chapter 2, Sections 1–4 11
Environment types
c
Artificial Intelligence, spring 2013, Peter Ljunglöf; based on AIMA Slides
Stuart Russel and Peter Norvig, 2004 Chapter 2, Sections 1–4 12
Agent types
Four basic types in order of increasing generality:
– simple reflex agents
– reflex agents with state
– goal-based agents
– utility-based agents
All these can be turned into learning agents
c
Artificial Intelligence, spring 2013, Peter Ljunglöf; based on AIMA Slides
Stuart Russel and Peter Norvig, 2004 Chapter 2, Sections 1–4 13
Simple reflex agents
Agent Sensors
Environment
Condition−action rules What action I
should do now
Actuators
c
Artificial Intelligence, spring 2013, Peter Ljunglöf; based on AIMA Slides
Stuart Russel and Peter Norvig, 2004 Chapter 2, Sections 1–4 14
Example
def reflex_vacuum_agent(sensors):
if sensors[’status’] == ’Dirty’:
return ’Suck’
elif sensors[’location’] == ’A’:
return ’Right’
elif sensors[’location’] == ’B’:
return ’Left’
c
Artificial Intelligence, spring 2013, Peter Ljunglöf; based on AIMA Slides
Stuart Russel and Peter Norvig, 2004 Chapter 2, Sections 1–4 15
Reflex agents with state
Sensors
State
What the world
How the world evolves is like now
Environment
What my actions do
Agent Actuators
c
Artificial Intelligence, spring 2013, Peter Ljunglöf; based on AIMA Slides
Stuart Russel and Peter Norvig, 2004 Chapter 2, Sections 1–4 16
Example
c
Artificial Intelligence, spring 2013, Peter Ljunglöf; based on AIMA Slides
Stuart Russel and Peter Norvig, 2004 Chapter 2, Sections 1–4 17
Goal-based agents
Sensors
State
What the world
How the world evolves is like now
Environment
What my actions do What it will be like
if I do action A
Agent Actuators
c
Artificial Intelligence, spring 2013, Peter Ljunglöf; based on AIMA Slides
Stuart Russel and Peter Norvig, 2004 Chapter 2, Sections 1–4 18
Utility-based agents
Sensors
State
What the world
How the world evolves is like now
Environment
What my actions do What it will be like
if I do action A
What action I
should do now
Agent Actuators
c
Artificial Intelligence, spring 2013, Peter Ljunglöf; based on AIMA Slides
Stuart Russel and Peter Norvig, 2004 Chapter 2, Sections 1–4 19
Learning agents
Performance standard
Critic Sensors
feedback
Environment
changes
Learning Performance
element element
knowledge
learning
goals
Problem
generator
Agent Actuators
c
Artificial Intelligence, spring 2013, Peter Ljunglöf; based on AIMA Slides
Stuart Russel and Peter Norvig, 2004 Chapter 2, Sections 1–4 20
Summary
Agents interact with environments through actuators and sensors
The agent function describes what the agent does in all circumstances
The performance measure evaluates the environment sequence
A perfectly rational agent maximizes expected performance
Agent programs implement (some) agent functions
PEAS descriptions define task environments
Environments are categorized along several dimensions:
observable? deterministic? episodic? static? discrete? single-agent?
Several basic agent architectures exist:
reflex, reflex with state, goal-based, utility-based
c
Artificial Intelligence, spring 2013, Peter Ljunglöf; based on AIMA Slides
Stuart Russel and Peter Norvig, 2004 Chapter 2, Sections 1–4 21