Intelligent Agents
Intelligent Agents
Chapter 2
AGENTS AND
ENVIRONMENTS
An agent is anything that can be viewed as
perceiving its environment through sensors and
acting upon that environment through actuators.
A human agent has eyes, ears, and other organs
for sensors and hands, legs, mouth, and other
body parts for actuators.
A robotic agent might have cameras and infrared
range finders for sensors and various motors for
actuators.
A software agent receives keystrokes, file contents,
and network packets as sensory inputs and acts on
the environment by displaying on the screen,
writing files, and sending network packets.
Percept
agent's perceptual inputs at any given instant
percept sequence
percept sequence is the complete history of
everything the agent has ever perceived
an agent's choice of action at any given
instant can depend on the entire percept
sequence observed to date.
If we can specify the agent's choice of action
for every possible percept sequence, then we
have said more or less everything there is to
say about the agent.
AGENT FUNCTION
Mathematically speaking, we say that an
agent's behaviour is described by the agent
function that maps any given percept
sequence to an action.
agent function that describes any given agent
can be tabulated
a very large table-infinite for some agents
(unless we place a bound on the length of
percept sequences we want to consider)
Given an agent to experiment with, we can, in
principle, construct this table by trying out all
possible percept sequences and recording
which actions the agent does in response.
Cont..
Internally, the agent function for an
artificial agent will be implemented
by an agent program.
The agent function is an abstract
mathematical description; the agent
program
is
a
concrete
implementation, running on the
agent architecture.
Example
the vacuum-cleaner world shown in Figure 2.2.
This world is so simple that we can describe
everything that happens; it's also a made-up
world, so we can invent many variations. This
particular world has just two locations: squares
A and B. The vacuum agent perceives which
square it is in and1 whether there is dirt in the
square. It can choose to move left, move right,
suck up the dirt, or do nothing. One very simple
agent function is the following: if the current
square is dirty, then suck, otherwise move to the
other square
A partial tabulation of this agent function is
shown in Figure 2.3.
RATIONALITY (WISDOM)
A rational agent is one that does the
right thing--conceptually speaking,
every entry in the table for the agent
function is filled out correctly.
what does it mean to do the right thing?
the right action is the one that will cause the
agent to be most successful.
Therefore, we will need some way to
measure success.
Performance measures
A performance measure represents the
criterion for success of an agent's behaviour
When an agent is plunked down in an
environment, it generates a sequence of
actions according to the percepts it receives.
This sequence of actions causes the
environment to go through a sequence of
states.
If the sequence is desirable, then the agent
has performed well. (not one fixed measure
suitable for all agents)
Your Assignment
"clean floor" in the preceding paragraph is based
on average cleanliness over time. Yet the same
average cleanliness can be achieved by two
different agents, one of which does a mediocre
job all the time: while the other cleans
energetically but takes long breaks.
Which is preferable might seem to be a fine point of
janitorial science, but in fact it is a deep philosophical
question with far-reaching implications. Which is
better-a reckless life of highs and lows, or a safe but
humdrum existence? Which is better-an economy
where everyone lives in moderate poverty, or one in
which some live in plenty while others are very poor?
Rationality
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.
Consider the lowly dung beetle. After digging its nest and laying
its eggs, it fetches a ball of dung from a nearby heap to plug the
entrance. If the ball of dung is removed from its grasp en route,
the beetle continues on and pantomimes (Communication by
means of gesture and facial expression ) plugging the nest with
the non existent dung ball, never noticing that it is missing.
Evolution has built an assumption into the beetle's behavior, and
when it is violated, unsuccessful behavior results.
Slightly more intelligent is the sphex wasp. The female sphex will
dig a hole, go out and sting a caterpillar and drag it to the
burrow, enter the burrow again to check all is well, drag the
caterpillar inside, and lay its eggs. The caterpillar serves as a
food source when the eggs hatch. So far so good, but if an
entomologist moves the caterpillar a few inches away while the
sphex is doing the check, it will revert back to the "drag" step of
its plan, and will continue the plan without modification, even
after dozens of caterpillar-moving interventions. The sphex is
unable to learn that its innate(in-born) plan is failing, and thus
will not change it.
AUTONOMY
an agent relies on the prior knowledge of its designer rather
than on its own percepts, we say that the agent lacks
autonomy.
A rational agent should be autonomous-it should learn what it
can to compensate for partial or incorrect prior knowledge.
For example, a vacuum-cleaning agent that learns to foresee
where and when additionaldirt will appear will do better than
one that does not. As a practical matter, one seldom requires
complete autonomy from the start: when the agent has had
little or no experience, it would have to act randomly unless
the designer gave some assistance. So, just as evolution
provides animals with enough built-in reflexes so that they can
survive long enough to learn for themselves, it would be
reasonable to provide an artificial intelligent agent with some
initial knowledge as well as an ability to learn. After sufficient
experience of its environment, the behavior of a rational agent
can become effectively independent of its prior knowledge.
Autonomy(independence,
self-rule)
A system is autonomous to the extent that
its own behavior is determined by its own
experience.
Therefore, a system is not autonomous if it
is guided by its designer according to a
priori decisions.
To survive, agents must have:
Enough built-in knowledge to survive.
The ability to learn.
Autonomy
Example
An alarm that goes off at a pre-specified time
is not autonomous
An alarm that goes off when smoke is sensed
is autonomous
Nature of Environments
task environments
"problems" to which rational agents are
the "solutions
SOFTWARE AGENTS
SOFTBOTS
contrast, some software agents (or software
In
robots or softbots) exist in rich, un-limited domains.
Imagine a softbot designed to fly a flight simulator for a
large commercial airplane. The simulator is a very
detailed, complex environment including other aircraft
and ground operations, and the software agent must
choose from a wide variety of actions in real time.
imagine a softbot designed to scan Internet news
sources and show the interesting items to its
customers. To do well, it will need some natural
language processing abilities, it will need to learn what
each customer is interested in, and it will need to
change its plans dynamically-for example, when the
connection for one news source goes down or when a
new one comes online. The Internet is an environment
whose complexity rivals that of the physical world and
whose inhabitants include many artificial agents.
Properties of task
environments
Deterministic vs.
stochastic
If the next state
of the environment is completely
Strategic
If the environment is deterministic except for
the actions of other agents, we say that the
environment is startegic
Static vs dynamic
If the environment can change while an
agent is deliberating (calculating, planning)
then we say the environment is dynamic for
that agent; otherwise, it is static.
Static environments are easy to deal with
because the agent need not keep looking at
the world while it is deciding on an action,
nor need it worry about the passage of time
Dynamic environments, on the other hand,
are continuously asking the agent what it
wants to do; if it hasn't decided yet, that
counts as deciding to do nothing
Characteristics of
environments
Accessible Deterministic Episodic Static
Solitaire
Backgammon
Taxi driving
Internet
shopping
Medical
diagnosis
Discrete
Characteristics of
environments
Solitaire
Backgammon
Taxi driving
Internet
shopping
Medical
diagnosis
Discrete
No
Yes
Yes
Yes
Yes
Characteristics of
environments
Accessible Deterministic Episodic Static
Discrete
No
Yes
Yes
Yes
Yes
Backgammon Yes
No
No
Yes
Yes
Solitaire
Taxi driving
Internet
shopping
Medical
diagnosis
Characteristics of
environments
Accessible Deterministic Episodic Static
Discrete
No
Yes
Yes
Yes
Yes
Backgammon Yes
No
No
Yes
Yes
Taxi driving
No
No
No
No
Solitaire
Internet
shopping
Medical
diagnosis
No
Characteristics of
environments
Accessible Deterministic Episodic Static
Discrete
No
Yes
Yes
Yes
Yes
Backgammon Yes
No
No
Yes
Yes
Taxi driving
No
No
No
No
No
Internet
shopping
No
No
No
No
No
Solitaire
Medical
diagnosis
Characteristics of
environments
Accessible Deterministic Episodic Static
Discrete
No
Yes
Yes
Yes
Yes
Backgammon Yes
No
No
Yes
Yes
Taxi driving
No
No
No
No
No
Internet
shopping
No
No
No
No
No
Medical
diagnosis
No
No
No
No
No
Solitaire
Agent programs
The agent programs take the current
percept as input from the sensors
and return an action to the actuators.
difference between the agent
program, which takes the current
percept as input, and the agent
function, which takes the entire
percept history.
Model-based reflex
agents
Encode "internal state" of the world to remember the
past as contained in earlier percepts
Needed because sensors do not usually give the
entire state of the world at each input, so perception
of the environment is captured over time. "State"
used to encode different "world states" that generate
the same immediate percept.
Requires ability to represent change in the world; one
possibility is to represent just the latest state, but
then can't reason about hypothetical courses of action
Example: Rodney Brookss Subsumption Architecture
Brooks Subsumption
(include or place within
something large)
Architecture
Main idea: build complex, intelligent robots by
Goal-Based Agent
Choose actions so as to achieve a (given or computed)
goal.
A goal is a description of a desirable situation
Keeping track of the current state is often not enough -need to add goals to decide which situations are good
Deliberative (think about or discuss very carefully in
order to make decision) instead of reactive (response
to a problem)
May have to consider long sequences of possible
actions before deciding if goal is achieved -- involves
consideration of the future, what will happen if I
do...?
Utility-Based Agent
When there are multiple possible alternatives, how to
decide which one is best?
A goal specifies a crude (very simple or basic)
distinction between a happy and unhappy state, but
often need a more general performance measure
that describes "degree of happiness"
Utility function U: State --> Reals indicating a
measure of success or happiness when at a given
state
Allows decisions comparing choice between
conflicting goals, and choice between likelihood of
success and importance of goal (if achievement is
uncertain)
A Complete Utility-Based
Agent