Ai1 2
Ai1 2
AGENTS
Agents and
Environments
An agent is anything that can be viewed as perceiving its environment through
sensors and acting upon that environment through actuators
the term percept to refer to the agent’s perceptual inputs at any given instant
An agent’s 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, but not on anything it hasn’t perceived
an agent’s behavior is described by the agent function that maps any given percept sequence to
an action
[f: P* A]
The agent program runs on the physical architecture to produce f, the agent function for an
artificial agent will be implemented by an agent program
agent = architecture + program
The agent function is an abstract mathematical description; the agent program is a concrete
implementation, running within some physical system.
The Vacuum Cleaner
World
This particular world has just two locations: squares A and B.
The vacuum agent perceives which square it is in and 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.
Percepts: location and contents, e.g., [A,Dirty]
Actions: Left, Right, Suck, NoOp
Agent’s function look-up table
For many agents this is a very large table
Good Behaviour: Concept of
•Rationality
A rational agent is one that does the right thing
•what does it mean to do the right thing?
by considering the consequences of the agent’s behavior
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.
This notion of desirability is captured by a performance measure that evaluates
any given sequence of environment states.
Example- Vacuum Cleaner
Revisited
We might propose to measure performance by the amount of dirt cleaned up in a single
eight-hour shift.
With a rational agent, of course, what you ask for is what you get.
A rational agent can maximize this performance measure by cleaning up the dirt, then
dumping it all on the floor, then cleaning it up again, and so on.
A more suitable performance measure would reward the agent for having a clean
floor.
For example, one point could be awarded for each clean square at each time step
(perhaps with a penalty for electricity consumed and noise generated).
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.
Performance measure: An objective criterion for success of an agent's behavior.
To build a rational agent in this way, we as designers must construct a table that contains the appropriate action for
every possible percept sequence.
Let P be the set of possible percepts and let T be the lifetime of the agent (the total number of percepts
it will receive)
The lookup table will contain entries
Consider the automated taxi: the visual input from a single camera comes in at the rate of roughly 27
megabytes per second (30 frames per second, 640 × 480 pixels with 24 bits of color information). This
gives a lookup table with over 10250,000,000,000 entries for an hour’s driving.
Even the lookup table for chess a tiny, well-behaved fragment of the real world would have at least
10150 entries.
The daunting size of these tables (the number of atoms in the observable universe is less than 1080)
means that
a) no physical agent in this universe will have the space to store the table,
b) the designer would not have time to create the table,
c) no agent could ever learn all the right table entries from its experience, and
d) even if the environment is simple enough to yield a feasible table size, the designer still has no
guidance about how to fill in the table entries.
Types of Agent
Programs
Four basic kinds of agent programs that embody the principles underlying almost
all intelligent systems:
1. Simple reflex agents;
2. Model-based reflex agents;
3. Goal-based agents; and
4. Utility-based agents
Simple reflex
agents
Select actions on the basis of the current percept, ignoring the rest of the percept
history
Agents do not have memory of past world states or percepts.
So, actions depend solely on current percept.
Action becomes a “reflex.”
condition–action rule
if car-in-front-is-braking then initiate-braking
The INTERPRET-INPUT function generates an abstracted description of the
current state from the percept, and
the RULE-MATCH function returns the fifirst rule in the set of rules that
matches
the given state description. Note that the description in terms of “rules”
and “matching” is purely conceptual;
actual implementations can be as simple as a collection of logic gates
implementing a Boolean circuit
This will work only if the correct decision can be made on the basis of only the
current percept—that is, only if the environment is fully observable.
Even a little bit of unobservability can cause serious trouble. For example, the
braking rule given earlier assumes that the condition car-in-front-is-braking can
be determined from the current percept—a single frame of video.
This works if the car in front has a centrally mounted brake light.
Infinite loops are often unavoidable for simple reflex agents operating in
partially observable environments
Escape from infifinite loops is possible if the agent can randomize its
actions.
Model-based reflex agents
Key difference (wrt simple reflex agents):
◦Agents have internal state, which is used to keep track of past states of the world.
“Infers potentially
dangerous driver
in front.”
If “dangerous driver in front,”
then “keep distance.”
internal state information as time goes by requires two kinds of knowledge to be encoded in the
agent program
1. we need some information about how the world evolves independently of the agent
2. we need some information about how the agent’s own actions affect the world
knowledge about “how the world works is called a model of the world. An agent that uses such a model
is called a model-based agent.
UPDATE-STATE, which is responsible for creating the new internal state description.
Goal-based agents
Key difference wrt Model-Based Agents:
In addition to state information, have goal information that
describes desirable situations to be achieved.
Search and planning are the subfields of AI devoted to finding action sequences that achieve the
agent’s goals