Anda di halaman 1dari 21

Artificial Intelligence (AI)

Lecture 2

Sikandar S. Toor
https://sites.google.com/site/uolcsai

Textbook: Artificial Intelligence: A Modern Approach


by Peter Norvig & Stuart Russel

Intelligent Agent

An agent is anything that can be viewed as


perceiving its environment through sensors
and acting upon that environment through
actuators.
General assumption is that every agent can
perceive its own actions but not always the
effects.
Also called bot.

An Intelligent Agent
Sensors
percepts
?
Agent

Environment

actions
Actuators

The agents behavior is a mathematical function that maps given


percept sequence to action:
P* = Percept History
A = Actions

f : P* A

The agent program runs on the physical architecture to produce f

Agents - Examples

A human agent has eyes, ears, and other organs for


sensors and hands, legs, mouth and other body parts for
actuators
A robotic agent substitutes cameras and infrared range
finders for the sensors and various motors for the
actuators.
A software agent receives keystrokes, network packets,
file contents as sensory input and acts upon the
environment by displaying on screen, sending network
packets and writing files.

Percept & Percept Sequence

Percept refers to agents perceptual input


at any given instance
Percept sequence is the complete history of
everything agent has ever perceived

An agents choice of action at any given


instance can depend on the entire percept
sequence observed to-date

Agent Function

Mathematically, an agents behavior is described by the


agent function that maps any given percept sequence to
an action

We may tabulate agent function that describe any given agent


For most agent this would become a very large table. May be of
infinite size
We want to put a bound on the length of the percept sequence we
want to consider
This table is an external characterization of an agent
Internally, agent function for an artificial agent will be
implementation by an agent program

Vacuum-Cleaner Agent

Locations: square A, square B


Percepts: location and contents, e.g.,
[A,Dirty]
Actions: Left, Right, Suck, NoOp

Vacuum-Cleaner Agent
Percept Sequence

Action

[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

.
.

.
.

Good Behavior - Rationality

Rational Agent is the one which does the right


thing
The right action is the one that will cause the
agent to be most successful
The environment shall change with agents
sequence of actions
If the sequence is desirable, the agent has
performed well

Performance Measure

Performance measure is an objective criterion for success


of an agent's behavior
Performance measure can be defined by the designer who
constructed the agent
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
No one universal criterion of performance measure for
every agent
We could ask the agent for a subjective opinion of how
happy it is with its own performance

Performance Measure

The selection of performance measure is not


always easy

As a general rule, it is better to design a


performance measure according to what one
actually wants in the environment rather than
according to how one thinks the agent should
behave

Rationality

What is rational at given time depends upon


four things

The performance measure that defines criterion


for success
The agents prior knowledge of the environment
The actions that agent can perform
The agents percept sequence to-date

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.

Omniscience

An omniscience agent knows the actual


outcomes of its actions and can act
accordingly
Omniscience is impossible in reality
Omniscience is different from rationality

Perfection, Learning

Rationality is NOT the same as Perfection


Rationality maximizes expected performance
Perfection maximizes actual performance
A rational agent not only gather information
but also learn as much as possible from what
it perceives

Exploration

Doing actions in order to modify future


percepts, sometimes called information
gathering, is an important part of rationality
Information gathering is an important part of
rationality
It performs such actions to increase its
perception
This is called Exploration

Learning

We do not want our rational agent to gather


information only
We also want it to learn as much as it can from
what it perceives
Successful agents split the task of computing agent
function (learning) into 3 different periods

When designing
When agent is deliberating on its next action
When it learns from experience

Agent Autonomy

To what extent the agent is able to make decisions


and take actions on its own
The capacity to compensate for partial or incorrect
prior knowledge by learning
An agent is called autonomous if its behavior is
determined by its own experience (with ability to
learn and adopt)
A truly autonomous agent should be able to
operate successfully in a wide variety of
environments

Task Environment

The task environment are essentially the problems


for which the agent is solution
PEAS

P Performance Measure
E - Environment
A Actuators
S Sensors

First step in designing an agent must be to


define the task environment
19

PEAS - Example

Automated Taxi Driver Agent

Performance measure: Safe, correct destination,


minimum fuel consumption, min wear and tear, fast,
legal, comfortable trip, maximize profit
Environment: Roads, other traffic, pedestrians,
customers, stray animals, police cars, signals, potholes
Actuators: Steering wheel, accelerator, brake, signal,
horn, display, voice synthesizer
Sensors: Cameras, sonar, speedometer, accelerometer,
GPS, odometer, engine sensors, keyboard, mic

Agent Type and PEAS


Agent Type

Performance
Measures

Environment

Actuators

Sensors

Medical Diagnostic

Healthy patients,
minimize costs,
lawsuits

Patients, hospital,
staff

Display questions,
tests, diagnoses,
treatments,
referrals

Keyboard entry of
symptoms,
findings, patients
answers

Satellite image
analysis system

Correct image
characterization

Downlink from
orbiting satellite

Display
categorization of
scene

Color pixel arrays

Part picking robot

Percentage of parts
in correct bins

Conveyor belt with


parts, bins

Valves, pumps,
heaters, displays

Cameras, joint
angle sensors

Refinery controller

Maximize purity,
yield, safety

Refinery, operators

Valves, pumps,
heaters, displays

Temperature,
pressure, chemical
sensors

Anda mungkin juga menyukai