Download Outline Agents and environments Vacuum

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project

Document related concepts
no text concepts found
Transcript
Outline
♦ Agents and environments
♦ Rationality
Intelligent Agents
♦ PEAS (Performance measure, Environment, Actuators, Sensors)
♦ Environment types
♦ Agent types
Chapter 2, Sections 1–4
c
Artificial Intelligence, spring 2013, Peter Ljunglöf; based on AIMA Slides Stuart
Russel and Peter Norvig, 2004
Chapter 2, Sections 1–4
1
c
Artificial Intelligence, spring 2013, Peter Ljunglöf; based on AIMA Slides Stuart
Russel and Peter Norvig, 2004
Agents and environments
Chapter 2, Sections 1–4
2
Chapter 2, Sections 1–4
4
Vacuum-cleaner world
sensors
A
percepts
B
?
environment
actions
agent
actuators
Agents include humans, robots, softbots, thermostats, etc.
The agent function maps from percept histories to actions:
Percepts: location and contents, e.g., [A, Dirty]
∗
f :P →A
Actions: Left, Right, Suck, N oOp
The agent program runs on the physical architecture to produce f
c
Artificial Intelligence, spring 2013, Peter Ljunglöf; based on AIMA Slides Stuart
Russel and Peter Norvig, 2004
Chapter 2, Sections 1–4
3
A vacuum-cleaner agent
c
Artificial Intelligence, spring 2013, Peter Ljunglöf; based on AIMA Slides Stuart
Russel and Peter Norvig, 2004
Rationality
A simple agent function is:
If the current square is dirty, then suck;
otherwise, move to the other square.
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?
. . . or as pseudo-code:
A rational agent chooses any action that
– maximizes the expected value of the performance measure
– given the percept sequence to date
function Reflex-Vacuum-Agent( [location,status]) returns an action
if status = Dirty then return Suck
else if location = A then return Right
else if location = B then return Left
How do we know if this is a good agent function?
What is the best function?
Is there one?
Rational 6= omniscient
– percepts may not supply all relevant information
Rational 6= clairvoyant
– action outcomes may not be as expected
Hence, rational 6= successful
Who decides this?
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
5
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
Automated taxi
To design a rational agent, we must specify the task environment,
which consists of the following four things:
The task environment for an automated taxi:
Performance measure??
Performance measure?? Safety, destination, profits, legality, comfort, . . .
Environment??
Environment?? Streets, traffic, pedestrians, weather, . . .
Actuators??
Actuators?? Steering, accelerator, brake, horn, speaker/display, . . .
Sensors??
Sensors?? Video, accelerometers, gauges, engine, keyboard, GPS, . . .
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
c
Artificial Intelligence, spring 2013, Peter Ljunglöf; based on AIMA Slides Stuart
Russel and Peter Norvig, 2004
Internet shopping agent
Chapter 2, Sections 1–4
Question-answering system
The task environment for an internet shopping agent:
The task environment for a question-answering system:
Performance measure?? Price, quality, appropriateness, efficiency
Performance measure?? User satisfaction? Known questions?
Environment?? Current and future WWW sites, vendors, shippers
Environment?? Wikipedia, Wolfram alpha, ontologies, encyclopedia, . . .
Actuators?? Display to user, follow URL, fill in form
Actuators?? Spoken/written language
Sensors?? HTML pages (text, graphics, scripts)
Sensors?? Written/spoken input
c
Artificial Intelligence, spring 2013, Peter Ljunglöf; based on AIMA Slides Stuart
Russel and Peter Norvig, 2004
8
Chapter 2, Sections 1–4
9
c
Artificial Intelligence, spring 2013, Peter Ljunglöf; based on AIMA Slides Stuart
Russel and Peter Norvig, 2004
Question-answering system: Jeopardy!
Chapter 2, Sections 1–4
10
Environment types
Solitaire
The task environment for a question-answering system:
Backgammon
Internet shopping
Taxi
Observable??
Deterministic??
Episodic??
Static??
Discrete??
Single-agent??
Performance measure?? $ $ $
Environment?? Wikipedia, Wolfram alpha, ontologies, encyclopedia, . . .
Actuators?? Spoken/written language, answer button
Sensors?? Written/spoken input
Why did IBM choose Jeopardy as its goal for a QA system?
Because of the peformance measure!
c
Artificial Intelligence, spring 2013, Peter Ljunglöf; based on AIMA Slides Stuart
Russel and Peter Norvig, 2004
Chapter 2, Sections 1–4
11
c
Artificial Intelligence, spring 2013, Peter Ljunglöf; based on AIMA Slides Stuart
Russel and Peter Norvig, 2004
Chapter 2, Sections 1–4
12
Environment types
Observable??
Deterministic??
Episodic??
Static??
Discrete??
Single-agent??
Solitaire
Yes
Backgammon
Yes
Environment types
Internet shopping
No
c
Artificial Intelligence, spring 2013, Peter Ljunglöf; based on AIMA Slides Stuart
Russel and Peter Norvig, 2004
Taxi
No
Chapter 2, Sections 1–4
Observable??
Deterministic??
Episodic??
Static??
Discrete??
Single-agent??
13
Solitaire
Yes
Yes
No
Backgammon
Yes
No
No
Taxi
No
No
No
Chapter 2, Sections 1–4
Observable??
Deterministic??
Episodic??
Static??
Discrete??
Single-agent??
15
Solitaire
Yes
Yes
No
Yes
Yes
Backgammon
Yes
No
No
Semi
Yes
Solitaire
Yes
Yes
No
Yes
Backgammon
Yes
No
No
Semi
Taxi
No
No
Chapter 2, Sections 1–4
Internet shopping
No
Partly
No
Semi
c
Artificial Intelligence, spring 2013, Peter Ljunglöf; based on AIMA Slides Stuart
Russel and Peter Norvig, 2004
Environment types
Observable??
Deterministic??
Episodic??
Static??
Discrete??
Single-agent??
Internet shopping
No
Partly
14
Environment types
Internet shopping
No
Partly
No
c
Artificial Intelligence, spring 2013, Peter Ljunglöf; based on AIMA Slides Stuart
Russel and Peter Norvig, 2004
Backgammon
Yes
No
c
Artificial Intelligence, spring 2013, Peter Ljunglöf; based on AIMA Slides Stuart
Russel and Peter Norvig, 2004
Environment types
Observable??
Deterministic??
Episodic??
Static??
Discrete??
Single-agent??
Solitaire
Yes
Yes
Taxi
No
No
No
No
Chapter 2, Sections 1–4
16
Environment types
Internet shopping
No
Partly
No
Semi
Yes
Taxi
No
No
No
No
No
Observable??
Deterministic??
Episodic??
Static??
Discrete??
Single-agent??
Solitaire
Yes
Yes
No
Yes
Yes
Yes
Backgammon
Yes
No
No
Semi
Yes
No
Internet shopping Taxi
No
No
Partly
No
No
No
Semi
No
Yes
No
Yes*
No
*except auctions
The environment type largely determines the agent design
The real world is (of course) partially observable, stochastic, sequential,
dynamic, continuous, multi-agent
c
Artificial Intelligence, spring 2013, Peter Ljunglöf; based on AIMA Slides Stuart
Russel and Peter Norvig, 2004
Chapter 2, Sections 1–4
17
c
Artificial Intelligence, spring 2013, Peter Ljunglöf; based on AIMA Slides Stuart
Russel and Peter Norvig, 2004
Chapter 2, Sections 1–4
18
Agent types
Simple reflex agents
Agent
Sensors
What the world
is like now
All these can be turned into learning agents
Condition−action rules
What action I
should do now
Environment
Four basic types in order of increasing generality:
– simple reflex agents
– reflex agents with state
– goal-based agents
– utility-based agents
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
c
Artificial Intelligence, spring 2013, Peter Ljunglöf; based on AIMA Slides Stuart
Russel and Peter Norvig, 2004
Example
Sensors
State
How the world evolves
What the world
is like now
What my actions do
def reflex_vacuum_agent(sensors):
if sensors[’status’] == ’Dirty’:
return ’Suck’
elif sensors[’location’] == ’A’:
return ’Right’
elif sensors[’location’] == ’B’:
return ’Left’
Condition−action rules
Agent
Chapter 2, Sections 1–4
21
What action I
should do now
Environment
if status = Dirty then return Suck
else if location = A then return Right
else if location = B then return Left
Actuators
c
Artificial Intelligence, spring 2013, Peter Ljunglöf; based on AIMA Slides Stuart
Russel and Peter Norvig, 2004
Example
Chapter 2, Sections 1–4
22
Goal-based agents
function Reflex-Vacuum-Agent( [location,status]) returns an action
static: last A, last B, numbers, initially ∞
Sensors
State
if status = Dirty then . . .
How the world evolves
What the world
is like now
What my actions do
What it will be like
if I do action A
Goals
What action I
should do now
Agent
Chapter 2, Sections 1–4
23
Environment
initial_state = {’last-A’: maxint, ’last-B’: maxint}
def reflex_vacuum_agent_state(sensors, state=initial_state):
if sensors[’status’] == ’Dirty’:
if sensors[’location’] == ’A’:
state[’last-B’] = 0
else:
state[’last-A’] = 0
return ’Suck’
elif sensors[’location’] == ’A’ and state[’last-B’] > 3:
return ’Right’
elif sensors[’location’] == ’B’ and state[’last-A’] > 3:
return ’Left’
else:
return ’NoOp’
c
Artificial Intelligence, spring 2013, Peter Ljunglöf; based on AIMA Slides Stuart
Russel and Peter Norvig, 2004
20
Reflex agents with state
function Reflex-Vacuum-Agent( [location,status]) returns an action
c
Artificial Intelligence, spring 2013, Peter Ljunglöf; based on AIMA Slides Stuart
Russel and Peter Norvig, 2004
Chapter 2, Sections 1–4
Actuators
c
Artificial Intelligence, spring 2013, Peter Ljunglöf; based on AIMA Slides Stuart
Russel and Peter Norvig, 2004
Chapter 2, Sections 1–4
24
Utility-based agents
Learning agents
Performance standard
Sensors
State
What my actions do
What it will be like
if I do action A
Utility
How happy I will be
in such a state
What action I
should do now
Agent
feedback
changes
Learning
element
Performance
element
Problem
generator
Agent
Chapter 2, Sections 1–4
25
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
knowledge
learning
goals
Actuators
c
Artificial Intelligence, spring 2013, Peter Ljunglöf; based on AIMA Slides Stuart
Russel and Peter Norvig, 2004
Sensors
Critic
Environment
What the world
is like now
Environment
How the world evolves
Chapter 2, Sections 1–4
27
Actuators
c
Artificial Intelligence, spring 2013, Peter Ljunglöf; based on AIMA Slides Stuart
Russel and Peter Norvig, 2004
Chapter 2, Sections 1–4
26
Related documents