Professional Documents
Culture Documents
B. For each of the following activities: (20%) 1. Playing soccer.
B. For each of the following activities: (20%) 1. Playing soccer.
B. For each of the following activities: (20%) 1. Playing soccer.
agent.
• Mathematically speaking, we say that an agent’s behavior is
described by the agent function that maps any given percept
sequence to an action.
Agent program
• The table of agent function can be constructed by trying out all
possible percept sequences and recording which actions the agent
does in response.
• The table is an external characterization of the agent.
• Internally, the agent function for an artificial agent will be
implemented by an agent program.
• It is important to keep these two ideas distinct.
• The agent function is an abstract mathematical description; the
agent program is a concrete implementation, running within some
physical system.
Example: the vacuum-cleaner world
• A robotic vacuum-cleaning agent in a world consisting
of squares that can be either dirty or clean.
• Figure 2.2 shows a conBiguration with just two squares,
A and B.
• The vacuum agent perceives which square it is in and
whether there is dirt in the square. Figure 2.2 A vacuum-cleaner world
with just two locations.
• The agent starts in square A.
• The available actions are to move to the right, move to the left, 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 and an agent
program that implements it appears in Figure 2.8
Example: the vacuum-cleaner world
Figure 2.3 Partial tabulation of a simple agent function for the vacuum-
cleaner world shown in Figure 2.2. The agent cleans the current square if
it is dirty, otherwise it moves to the other square. Note that the table is of
unbounded size unless there is a restriction on the length of possible
percept sequences.
Example: the vacuum-cleaner world
3. The Concept of
Rationality
The Concept of Rationality
• A rational agent is one that does the right thing.
• Obviously, doing the right thing is better than doing the wrong
thing, but what does it mean to do the right thing?
Performance measures
• The notion of “the right thing” in AI called consequentialism: we
evaluate an agent’s behavior by its consequences.
• 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.
Performance measures
• Humans have desires and preferences of their own, so the notion of
rationality as applied to humans has to do with their success in
choosing actions that produce sequences of environment states that
are desirable from their point of view.
• Machines, on the other hand, do not have desires and preferences of
their own; the performance measure is in the mind of the designer
of the machine, or in the mind of the users the machine is designed
for.
• Some agent designs have an explicit representation of the
performance measure, while in other designs the performance
measure is entirely implicit—the agent may do the right thing, but it
doesn’t know why.
Performance measures
• Performance measure for the vacuum-cleaner agent be the amount of
dirt cleaned up in a single eight-hour shift.
• With a rational agent 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 to be achieved in the environment, rather
than according to how one thinks the agent should behave.
Performance measures
• The notion of “clean Bloor” 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.
• Deep philosophical question with far-reaching implications:
o Which is better—a reckless life of highs and lows, or a safe but humdrum
existence?
o 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
• The rationality of an agent is measured by its performance
measure.
• Rationality can be judged on the basis of following points:
o Performance measure which deBines the success criterion.
o Agent prior knowledge of its environment.
o Best possible actions that an agent can perform.
o The sequence of percepts.
Definition of a rational agent
This leads to a 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.
Example: the vacuum-cleaner
• The simple vacuum-cleaner agent with agent function tabulated
in Figure 2.3, a rational agent?
• First, we need to say what the performance measure is, what is
known about the environment, and what sensors and actuators
the agent has. Let us assume the following:
• 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 (Figure 2.2) but
the dirt distribution and the initial location of the agent are not. Clean
squares stay clean and sucking cleans the current square.
Example: the vacuum-cleaner
• The Right and Left actions move the agent one square except when
this would take the agent outside the environment, in which case the
agent remains where it is.
• The only available actions are Right, Left, and Suck.
• The agent correctly perceives its location and whether that location
contains dirt.
• Under these circumstances the agent is indeed rational; its
expected performance is at least as good as any other agent’s.
4. The Nature of
Environments
Specifying the task environment
• To specify the performance measure, the environment, and the
agent’s actuators and sensors.
• All these are grouped under the heading of the task environment.
• For the acronymically minded, we call PEAS (Performance,
Environment, Actuators, Sensors) description.
• In designing an agent, the first step must always be to specify the
task environment as fully as possible.
PEAS for Self-driving Cars
• PEAS representation of a self-driving car:
o Performance: Safety, time, legal drive,
comfort
o Environment: Roads, other vehicles, road
signs, pedestrian
o Actuators: Steering, accelerator, brake,
signal, horn
o Sensors: Camera, GPS, speedometer,
odometer, accelerometer, sonar.
Properties of task environments
• Fully Observable vs Partially Observable:
o When an agent sensor can perceive the whole state of an agent at any
point in time, the environment is said to be fully observable; otherwise, it
is partially observable.
o Maintaining a completely visible environment is simple since there is no
need to keep track of the surrounding history.
o When the agent has no sensors in all environments, the environment is
said to be unobservable.
• For examples:
o Chess – the board and the opponent’s movements are both fully
observable.
o Driving – the environment is partially observable because what’s around
the corner is not known.
Properties of task environments
• Deterministic vs nondeterministic
o A deterministic environment is one in which an agent’s present state and
chosen action totally determine the upcoming state of the environment.
o Otherwise, it is nondeterministic.
• For examples:
o Chess – In its current state, a piece has just a few alternative moves, and
these moves can be determined.
o Self-Driving Cars – The activities of self-driving cars are not consistent;
they change over time. Taxi driving is clearly nondeterministic in this
sense.
• Stochastic:
o used by some as a synonym for “nondeterministic
Competitive vs Collaborative
• When an agent competes with another agent to optimize output, it
is said to be in a competitive environment.
• When numerous agents work together to generate the required
result, the agent is said to be in a collaborative environment.
• Examples:
o Chess – the agents compete with each other to win the game which is the
output.
o Self-Driving Cars – When numerous self-driving cars are located on the
road, they work together to prevent crashes and arrive at their
destination, which is the intended result.
Single-agent vs Multi-agent
• A single-agent environment has only one agent.
• A multi-agent environment has more than one agent.
• Examples:
o A person left alone in a maze is an example of a single-agent environment.
o Football is a multi-agent game since each team has 11 players.
Dynamic vs Static
• A dynamic environment is one that changes frequently when the
agent is doing some action.
• A static environment is one that does not change its state.
• Examples:
o A roller coaster ride is dynamic since it is in motion and the environment
changes all the time.
o An empty house is static because nothing changes when an agent arrives.
Discrete vs Continuous
• When there are a Binite number of percepts and actions that may
be done in an environment, that environment is referred to as a
discrete environment.
• The environment in which actions are performed that cannot be
counted is referred to be continuous.
• Examples:
o Chess is a discrete game since it has a Binite number of moves.
o Self-driving cars are an example of continuous environments since their
activities, such as driving, parking, and so on, cannot be counted.
Episodic vs Sequential
• Each of the agent’s activities in an Episodic task environment is broken
into atomic events or episodes.
• There is no link between the present and past events.
• Example:
o Consider the Pick and Place robot, which is used to detect damaged components
from conveyor belts. There is no dependency between past and present
decisions.
• Previous decisions in a Sequential environment can influence all future
decisions.
• The agent’s next action is determined by what action they have taken
before and what action he is expected to take in the future.
• Example:
o Checkers - A game in which the previous move affects all following movements.
Known vs Unknown
• In a known environment, the results of all actions are known to
the agent. While in an unknown environment, the agent must
learn how it works to perform an action.
5. The Structure of
Agents
Intelligent Agent Structure
• Agent’s structure can be viewed as:
o Agent = Architecture + Agent Program
• The main three terms involved in the structure:
o Architecture: is machinery that an AI agent executes on.
o Agent Function: is used to map a percept to an action: f: P* → A
o Agent program: is an implementation of agent function.
• An agent program executes on the physical architecture to produce
function f.
Types of Agent
• Agents can be grouped into Bive classes based on their degree of
intelligence and capability.
Simple Reflex Agents
• They choose actions only based on the
current percept.
• They are rational only if a correct
decision is made only on the basis of
current precept.
• Their environment is completely
observable.
• Condition-Action Rule:
o is a rule that maps a state (condition) to
an action
o if condition then take action
Model Based Reflex Agents