Professional Documents
Culture Documents
Lecture 02 - Rational Agents PDF
Lecture 02 - Rational Agents PDF
Artificial Intelligence
Lecture # 02
28 January 2020
Spring 2020
FAST – NUCES, Faisalabad Campus
Zain Iqbal
Zain.iqbal@nu.edu.pk
CS401-Spring-20 1
Today’sTopics
Rational agent
Agents and environments
Nature of environments
◦ PEAS
◦ Properties
CS401-Spring-20 2
Approaches to AI
The science of making machines that:
CS401-Spring-20 3
Agents and Environments
An agent is an entity that perceives its
environment through sensors and acts upon
it through actuators.
CS401-Spring-20 4
Agents and Environments
CS401-Spring-20
Few terminologies
Percept: agent’s perceptual input at any
given stage
CS401-Spring-20 7
Agent Function & Agent Program
CS401-Spring-20 8
Vacuum Cleaner World Example
CS401-Spring-20 9
Rational agents 7
• An agent should strive to "do the right thing", based on what it can
perceive and the actions it can perform.
• The right action is the one that will cause the agent to be
most successful
• Performance measure: An objective criterion for success of
an agent's behavior
• E.g., performance measure of a vacuum-cleaner agent could be
amount of dirt cleaned up, amount of time taken, amount of
electricity consumed, amount of noise generated, etc.
• As a general rule, 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 (amount
of dirt cleaned vs a clean floor)
• A more suitable measure would reward the agent for having
a clean floor
CS401-Spring-20
Rational Agent
An agent which does the right thing.
CS401-Spring-20 10
Rationality
Rationality at any given time depends on
four things:
1. Performance measure that defines the
criterion of success
2. Agent’s prior knowledge of the environment
3. Actions that the agent can perform
4. Agent’s percept sequence to the date
CS401-Spring-20 11
Rational Agent
CS401-Spring-20 15
Vacuum cleaner agent
Let’s assume the following
•
– The performance measure awards one point for each clean square at each
time step, over a lifetime of 1000 time steps
–
The geography of the environment is known a "priori" but the dirt
distribution and the initial location of the agent are not. Clean squares stay
clean and the sucking cleans the current square. The Left and Right actions
– move the agent left and right except when this would take the agent outside
– the environment, in which case the agent remains where it is
The only available actions are Left, Right, Suck and NoOp
• The agent correctly perceives its location and whether that location contains
dirt
Under these circumstances the agent is rational:its
expected performance is at least as high as any
other agent’s
CS401-Spring-20
Vacuum-cleaner world
• Two locations: A and B
• Percepts: location and contents, e.g., [A,Dirty]
• Actions: Left, Right, Suck, NoOp
Percept sequence Actions
[A,Clean] Right
[A, Dirty] Suck
[B,Clean] Left
[B,Dirty] Suck
[A,Clean],[A,Clean] Right
[A,Clean],[A,Dirty] Suck
… …
[A,Clean],[A.Clean],[A,Clean] Right
[A,Clean],[A,Clean],[A, Dirty] Suck
CS401-Spring-20 1
Vacuum cleaner agent
• Same agent would be irrational under different circumstances
– once all dirt is cleaned up it will oscillate needlessly back and forth.
– If the performance measure includes a penalty of one point for
each movement left or right, the agent will fare poorly.
– A better agent for this case would do nothing once it is sure that all
the squares are clean.
–
If the clean squares can become dirty again, the agent should
occasionally check and clean them if needed.
–
If the geography of the environment is unknown the agent will
need to explore it rather than stick to squares A and B
CS401-Spring-20
Few terminologies
Information gathering/Exploration: doing
actions in order to modify future percepts
Omniscience: knowing the actual outcome of
action(s)
Learning: not restricting the agent for
information gathering only but to make it
learn as much as possible from what it
perceives
Autonomy: ability to learn & adapt
something (based on its own experience) other
than prior knowledge
CS401-Spring-20 13
1
Rational agents
Rationality is distinct from omniscience (all-knowing with
• infinite knowledge)
• Rationality maximizes expected performance while
perfection maximizes actual performance
• 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)
CS401-Spring-20
Task Environments
These are essentially the “problems” to
which rational agents are the“solutions”
CS401-Spring-20 16
Task Environments
PEAS
Performance
Environment
Actuators
Sensors
CS401-Spring-20 17
PEAS for taxi driver
Agent Type:TaxiDriver
CS401-Spring-20
CS 4 01 - SPRING 2016 2
18
PEAS For Medical Diagnosis System
CS401-Spring-20 2
PEAS For Satellite Image Analysis
System
Agent Type: Satellite Image Analysis System
CS401-Spring-20 2
PEAS For Refinery Controller
CS401-Spring-20 2
PEAS for part-picking robot
AgentType:Part-picking robot
CS401-Spring-20
CS 401 - SP 2
RING 2016 19
PEAS for interactive English
tutor
AgentType: Interactive English tutor
Sensors Keyboard
CS401-Spring-20 2
CS 401 - SPRING 2016 20
Reading Material
Russell & Norvig: Chapter # 2
David Poole: Chapter # 1
CS401-Spring-20 24
3