CH 02
CH 02
Ch 02 Intelligent Agents
part1
1
Outline
2
An agent is any entity that can be viewed as:
• perceiving its environment through sensors, and
• acting upon that environment through actuators.
3
Agents and Environments [cont.]
Agents include humans, robots, softbots, thermostats, etc.
• human:
perceives: with eyes, ears, nose, hands, ...,
acts: with voice, hands, arms, legs, ...
• robot:
perceives: with video-cameras, infra-red sensors, radar, ...
acts: with wheels, motors,
• softbot:
perceives: receiving keystrokes, files, network packets, ...
acts: displaying on the screen, writing files, sending network packets
• thermostat:
perceives: with heat sensor, ...
acts: electric impulses to valves, devices, ...
4
Agents and Environments [cont.]
▪
▪
▪
▪
5
Key concepts
Percept and Percept sequences
percept: the collection of agent’s perceptual inputs at any given
instant
percept sequence: the complete history of everything the agent has
ever perceived
Agent program
Internally, the agent function for an artificial agent is implemented by an agent program.
8
Example : Vacuum cleaner [cont.]
A simple agent function
If the current square is dirty, then suck; otherwise, move to the other square.
⚫ Agent’s function -> look-up table
⚪ For many agents this is a very large table
Percept sequence Action
[A,Clean] Right
[A,Dirty] Suck
[B,Clean] Left
[B,Dirty] Suck
[A,Clean],[B,Clean] Left
[A,Clean],[B,Dirty] Suck
etc etc
Note: this agent function depends only on the last percept, not on the whole percept
sequence. 9
Example : Vacuum cleaner [cont.]
Corresponding agent program
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
10
Rational Agents
Intuition: a rational agent is one that “does the right thing”
i.e., every entry in the agent function-table is filled out correctly
What is the right thing?
Approximation: the most “succesfull” thing:
In a given environment, according to the percept sequence it
receives, an agent generates a sequence of actions, ...
... causing the environment to go through a sequence of states.
If such sequence is desirable, then the agent has performed well.
⇒ need a performance measure to evaluate any sequence of
environment states
Performance measure should be objective.
11
Rational Agents [cont.]
e.g. “how clean the floor is” is a better measure than “the
amount of dirt cleaned within a certain time”
12
Rational Agents [cont.]
What is rational at any given time depends on four things:
The performance measure that defines the criterion of success
The agent’s prior knowledge of the environment
The actions that the agent can perform
The agent’s percept sequence to date (from sensors)
Definition of a rational agent
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.
13
Example of Rational Agents: vacuum-cleaner agent
Under the following assumptions:
Performance measure: one point for each clean square at each time step, over 1000
time steps
Environment knowledge:
• “geography” known a priori,
• dirt distribution and agent initial location unknown
• [clean squares cannot become dirty again ]
Perception: self location, presence of dirt
Actions: Left, Right, Suck
Is the agent rational?
⇒ Yes! (provided the given performence measure)
Beware: if a penalty for each move is given, the agent behaves poorly
⇒ better agent: do nothing once it is sure all the squares are clean
14
Rationality vs. Omniscience vs. Perfection
Remark
Rationality ≠ Omniscience!
• An omniscient agent knows for sure the outcome of its actions
⇒ omniscience impossible in reality
• A rational agent may only know “up to a reasonable confidence”
(e.g., when crossing a road, what if something falling from a plane
flattens you? if so, would you be considered irrational?)
17
Task Environments - PEAS
18
PEAS: Vacuum Cleaner
19
PEAS: Automated taxi driver
Performance measure
• safety, destination, profits, comfort, ...
Environment
• streets/freeways, other traffic, pedestrians, ...
Actuators
• steering, accelerator, brake, horn, speaker/display, ...
Sensors
• video, sonar, speedometer, engine sensors, GPS, ...
Remark
Some goals to be measured may conflict!
e.g. profits vs. safety, profits vs. comfort, ...
=⇒ tradeoffs are required 20
▪
▪
▪
▪
▪
▪
▪
▪
21
PEAS: Part-picking robot
Performance measure
• Percentage of parts in correct bins
Environment
• Conveyor belt with parts, bins
Actuators
• Jointed arm and hand
Sensors
• Camera, joint angle sensors
22
PEAS: Interactive English tutor
Performance measure
• Maximize student's score on test
Environment
• Set of students
Actuators
• Screen display (exercises, suggestions, corrections)
Sensors
• Keyboard, microphone
23
Properties of Task Environments
Task environments can be categorized along six dimensions:
Fully observable vs. partially observable
Single-agent vs. multi-agent
Deterministic vs. stochastic
Episodic vs. sequential
Static vs. dynamic
Discrete vs. continuous
24
Properties of Task Environments [cont.]
Fully observable vs. partially observable
28
Properties of Task Environments [cont.]
Discrete vs. continuous
The state of the environment, the way time is handled,
and agents percepts & actions can be discrete or
continuous
Ex: Crossword puzzles: discrete state, time, percepts & actions
Ex : Chess: : discrete state, time, percepts & actions
Ex: Taxi driving: continuous state, time, percepts & actions
...
29
Properties of Task Environments [cont.]
Single-agent vs. multi-agent
A task environment is multi-agent iff contains other agents who are
also maximizing some performance measure that depends on the
current agent’s actions
latest condition essential
distinction between single- and multi-agent sometimes subtle
Two important cases
competitive multi-agent environment: other agents’ goals conflict with
or oppose to the agent’s goals
Ex: chess, war scenarios, taxi driving (compete for parking lot), ...
cooperative multi-agent environment: other agents’ goals coincide in
full or in part with the agent’s goals
• Ex: ants’ nest, factory, taxi driving (avoid collisions), ...
30
Properties of Task Environments [cont.]
Single-agent vs. multi-agent
different design problems for multi-agent wrt. single-agent
competitive: randomized behaviour often rational
(unpredictable)
collaborative: communication with other agents often
rational
Note
The simplest environment is fully observable, single-agent,
deterministic, episodic, static and discrete.
Ex: simple vacuum cleaner
Most real-world situations are partially observable, multi-agent,
stochastic, sequential, dynamic, and continuous.
Ex: taxi driving
32
Properties of Task Environments [cont.]
Example properties of task Environments