[go: up one dir, main page]

0% found this document useful (0 votes)
22 views82 pages

Slides Module2 1

Module 2 of the Bachelor of Science (Honours) in Data Science and Artificial Intelligence focuses on understanding agents and their environments, including definitions, rationality, and types of agents. It emphasizes the importance of specifying task environments using the PEAS (Performance, Environment, Actuators, Sensors) framework for designing rational agents. The module also discusses the evaluation of agent behavior and the concept of rationality in relation to performance measures.

Uploaded by

jyrfjidjjhstull
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views82 pages

Slides Module2 1

Module 2 of the Bachelor of Science (Honours) in Data Science and Artificial Intelligence focuses on understanding agents and their environments, including definitions, rationality, and types of agents. It emphasizes the importance of specifying task environments using the PEAS (Performance, Environment, Actuators, Sensors) framework for designing rational agents. The module also discusses the evaluation of agent behavior and the concept of rationality in relation to performance measures.

Uploaded by

jyrfjidjjhstull
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 82

Bachelor of Science (Honours) in Data Science and Artificial Intelligence

DA109: AI Basics

Module 2

Agents and Environment


Learning objective of Module 2

➢ To understand the fundamental concepts of different agents,


including their basic definitions, evaluate the behavior of agents in
different environments.

2
Parts
➢ Agents and Environments
❑ Brief overview of agents and environment

➢ Good Behavior: The Concept of Rationality


❑ Comprehensive understanding Concept of Rationality.

➢ The Nature of Environments


❑ Detailed analysis on types of environments.

➢ The Structure of Agents


❑ Aim to provide kind of agents with combination of particular components

➢ Knowledge-Based Agents
❑ Detailed discussion on knowledge-based agents with practical examples
3
Part - I
Agents and Environments

4
Agents and Environments

➢ An agent is anything that can be viewed as perceiving its environment through sensors and acting upon that
environment through actuators.

➢ We use 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.

➢ In general, 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.

➢ By specifying the agent’s choice of action for every possible percept sequence, we have said more or less
everything there is to say about the 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.

5
Agents and Environments

➢ An agent is anything that can be viewed as perceiving its environment through sensors and acting upon that
environment through actuators

Agents interact with environments through sensors and actuators


6
Standard Embedded System
Agents and Environments
Structure

ADC microcontroller DAC

ASIC FPGA

sensors actuators

Agents interact with environments ASIC: application-specific integrated circuit


through sensors and actuators FPGA: field programmable gate array

7
Agents and Environments

Types of Agents

Human-Agent: A human Robotic Agent: A Software Agent: Software


agent has eyes, ears, robotic agent can have agent can have
and other organs which cameras, infrared keystrokes, file contents as
work for sensors and range finder, NLP for sensory input and act on
hand, legs, vocal tract sensors and various those inputs and display
work for actuators. motors for actuators. output on the screen.

8
Rationality

➢ Consider the simple vacuum-cleaner agent,


❑ cleans a square if it is dirty and moves to the other square if not; this is the agent function tabulated.

❑ 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.

9
Rationality

➢ Consider the simple vacuum-cleaner agent,

➢ We see that various vacuum-world


agents can be defined simply by filling in
the right-hand column in various ways.

➢ What is the right way to fill out the table?


In other words, what makes an agent
good or bad, intelligent or stupid?

Partial tabulation of a simple agent function for the vacuum-


cleaner world

10
Part - II
Good Behavior: The Concept of Rationality

11
Good Behavior: The Concept of Rationality

➢ 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.

➢ Obviously, doing the right thing is better than doing the wrong thing, but what does it mean to do the right
thing?

12
Good Behavior: The Concept of Rationality

➢ 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.

➢ Notice that we said environment states, not agent states. If we define success in terms of agent’s opinion of
its own performance, an agent could achieve perfect rationality simply by deluding itself that its performance
was perfect.

13
Good Behavior: The Concept of Rationality

➢ Obviously, there is not one fixed performance measure for all tasks and agents; typically, a designer will
devise one appropriate to the circumstances.

➢ Consider, for example, the vacuum-cleaner agent from the preceding section. 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.

14
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.

➢ 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.

15
Rationality

➢ Is this a rational agent?

➢ That depends! 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:


❑ The 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 but the dirt distribution and the initial location of
the agent are not. Clean squares stay clean and sucking cleans the current square. The Left and
Right actions move the agent left and right except when this would take the agent outside the
environment, in which case the agent remains where it is.

❑ The only available actions are Left , Right, and Suck.

❑ The agent correctly perceives its location and whether that location contains dirt.
16
Part - III
The Nature of Environments

17
The Nature of Environments

➢ Now that we have a definition of rationality, we are almost ready to think about building rational agents.

➢ First, however, we must think about task environments, which are essentially the “problems” to which rational
agents are the “solutions.”

➢ We begin by showing how to specify a task environment, illustrating the process with a number of examples.

➢ We then show that task environments come in a variety of flavors. The flavor of the task environment directly
affects the appropriate design for the agent program.

18
Specifying the task Environment

➢ In our discussion of the rationality of the simple vacuum-cleaner agent, we had to specify the performance
measure, the environment, and the agent’s actuators and sensors.

➢ We group all these under the heading of the task environment. For the acronymically minded, we call this the
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.

➢ The vacuum world was a simple example; let us consider a more complex problem: an automated taxi driver.

19
Specifying the task Environment

➢ An automated taxi driver:

Agent Type
Taxi Driver Performance,
Environment,
Actuators,
Sensors

PEAS description of the task environment for an automated taxi.

20
Specifying the task Environment

➢ An automated taxi driver:

Agent Type Performance


Taxi Driver Safe, fast, legal,
comfortable trip,
maximize profits

PEAS description of the task environment for an automated taxi.

21
Specifying the task Environment

➢ An automated taxi driver:

Agent Type Performance Environment


Taxi Driver Safe, fast, legal, Roads, other
comfortable trip, traffic,
maximize profits pedestrians,
customers

PEAS description of the task environment for an automated taxi.

22
Specifying the task Environment

➢ An automated taxi driver:

Agent Type Performance Environment Actuators


Taxi Driver Safe, fast, legal, Roads, other Steering, accelerator,
comfortable trip, traffic, brake, signal, horn,
maximize profits pedestrians, display
customers

PEAS description of the task environment for an automated taxi.

23
Specifying the task Environment

➢ An automated taxi driver:

Agent Type Performance Environment Actuators Sensors


Taxi Driver Safe, fast, legal, Roads, other Steering, accelerator, Cameras, sonar,
comfortable trip, traffic, brake, signal, horn, speedometer, GPS,
maximize profits pedestrians, display accelerometer,
customers engine sensors,
keyboard

PEAS description of the task environment for an automated taxi.

24
Specifying the task Environment
➢ An automated taxi driver:
❑ First, what is the performance measure to which we would like our automated driver to aspire?
Desirable qualities include getting to the correct destination; minimizing fuel consumption; minimizing the
trip time or cost; minimizing violations of traffic laws and disturbances to other drivers; maximizing safety
and passenger comfort; maximizing profits.

❑ Next, what is the driving environment that the taxi will face? Any taxi driver must deal with a variety of
roads, ranging from rural lanes and urban alleys to 12-lane freeways. The roads contain other traffic,
pedestrians, stray animals, road works, police cars, puddles, and potholes.

❑ The actuators for an automated taxi include those available to a human driver: control over the engine
through the accelerator and control over steering and braking. In addition, it will need output to a display
screen or voice synthesizer to talk back to the passengers, and perhaps some way to communicate with
other vehicles, politely or otherwise.

❑ The basic sensors for the taxi will include one or more controllable video cameras so that it can see the
road; it might augment these with infrared or sonar sensors to detect distances to other cars and
obstacles. To avoid speeding tickets, the taxi should have a speedometer, and to control the vehicle
properly, especially on curves, it should have an accelerometer 25
Specifying the task Environment

➢ An Medical diagnosis system:

Agent Type Performance Environment Actuators Sensors


Medical Healthy patient, Patient, hospital, Screen display Keyboard (entry of
diagnosis system minimize costs, staff (questions, tests, symptoms, findings,
lawsuits diagnoses, patient's answers)
treatments, referrals)

PEAS description of the task environment for an Medical diagnosis system.

26
Specifying the task Environment
➢ Examples of agent types and their PEAS descriptions

Agent Type Performance Environment Actuators Sensors


Chess Win/loss/draw Game board moves Board position

Refinery Purity, yield, refinery, Valves, pumps, Temperature, pressure,


controller safety operators heaters, displays chemical sensors
Playing Soccer Score, Injuries, Player, referees, Strength, Stamina, Eyes, Ears, Mouth,
Team work Field, Crowd, Coordination Touch
Goals, Ball
Exploring Titan Underwater Shuttle, Rover, Communication, Camera, GPS,
mobility, safety, atmosphere, sustainability, Temperature, Pressure
Data, Navigation surface, ocean reliability
AI Book Price, Ease of Websites, Correct information, Picture, information,
Shopping site, Shipping internet, PC User eyes
time
27
Specifying the task Environment
➢ Examples of agent types and their PEAS descriptions

Agent Type Performance Environment Actuators Sensors

28
Specifying the task Environment
➢ Examples of agent types and their PEAS descriptions

Agent Type Performance Environment Actuators Sensors


Chess Win/loss/draw Game board moves Board position

29
Specifying the task Environment
➢ Examples of agent types and their PEAS descriptions

Agent Type Performance Environment Actuators Sensors


Chess Win/loss/draw Game board moves Board position

Refinery Purity, yield, refinery, Valves, pumps, Temperature, pressure,


controller safety operators heaters, displays chemical sensors

30
Specifying the task Environment
➢ Examples of agent types and their PEAS descriptions

Agent Type Performance Environment Actuators Sensors


Chess Win/loss/draw Game board moves Board position

Refinery Purity, yield, refinery, Valves, pumps, Temperature, pressure,


controller safety operators heaters, displays chemical sensors
Playing Soccer Score, Injuries, Player, referees, Strength, Stamina, Eyes, Ears, Mouth,
Team work Field, Crowd, Coordination Touch
Goals, Ball

31
Specifying the task Environment
➢ Examples of agent types and their PEAS descriptions

Agent Type Performance Environment Actuators Sensors


Chess Win/loss/draw Game board moves Board position

Refinery Purity, yield, refinery, Valves, pumps, Temperature, pressure,


controller safety operators heaters, displays chemical sensors
Playing Soccer Score, Injuries, Player, referees, Strength, Stamina, Eyes, Ears, Mouth,
Team work Field, Crowd, Coordination Touch
Goals, Ball
Exploring Titan Underwater Shuttle, Rover, Communication, Camera, GPS,
mobility, safety, atmosphere, sustainability, Temperature, Pressure
Data, Navigation surface, ocean reliability

32
Specifying the task Environment
➢ Examples of agent types and their PEAS descriptions

Agent Type Performance Environment Actuators Sensors


Chess Win/loss/draw Game board moves Board position

Refinery Purity, yield, refinery, Valves, pumps, Temperature, pressure,


controller safety operators heaters, displays chemical sensors
Playing Soccer Score, Injuries, Player, referees, Strength, Stamina, Eyes, Ears, Mouth,
Team work Field, Crowd, Coordination Touch
Goals, Ball
Exploring Titan Underwater Shuttle, Rover, Communication, Camera, GPS,
mobility, safety, atmosphere, sustainability, Temperature, Pressure
Data, Navigation surface, ocean reliability
AI Book Price, Ease of Websites, Correct information, Picture, information,
Shopping site, Shipping internet, PC User eyes
time
33
Specifying the task Environment
➢ Examples of agent types and their PEAS descriptions

Agent Type Performance Environment Actuators Sensors

34
Specifying the task Environment
➢ Examples of agent types and their PEAS descriptions

Agent Type Performance Environment Actuators Sensors


Medical Healthy patient, Patient, hospital, Display of questions, Keyboard entry of
diagnosis system reduced costs staff tests, diagnoses, symptoms, findings,
treatments, Referrals patient’s Answers

35
Specifying the task Environment
➢ Examples of agent types and their PEAS descriptions

Agent Type Performance Environment Actuators Sensors


Medical Healthy patient, Patient, hospital, Display of questions, Keyboard entry of
diagnosis system reduced costs staff tests, diagnoses, symptoms, findings,
treatments, Referrals patient’s Answers
Satellite image Correct image Downlink from Display of scene Color pixel arrays
analysis system categorization orbiting satellite categorization

36
Specifying the task Environment
➢ Examples of agent types and their PEAS descriptions

Agent Type Performance Environment Actuators Sensors


Medical Healthy patient, Patient, hospital, Display of questions, Keyboard entry of
diagnosis system reduced costs staff tests, diagnoses, symptoms, findings,
treatments, Referrals patient’s Answers
Satellite image Correct image Downlink from Display of scene Color pixel arrays
analysis system categorization orbiting satellite categorization
Part-picking Percentage of Conveyor belt Jointed arm and hand Camera, joint angle
robot parts in correct with parts; bins sensors
bins

37
Specifying the task Environment
➢ Examples of agent types and their PEAS descriptions

Agent Type Performance Environment Actuators Sensors


Medical Healthy patient, Patient, hospital, Display of questions, Keyboard entry of
diagnosis system reduced costs staff tests, diagnoses, symptoms, findings,
treatments, Referrals patient’s Answers
Satellite image Correct image Downlink from Display of scene Color pixel arrays
analysis system categorization orbiting satellite categorization
Part-picking Percentage of Conveyor belt Jointed arm and hand Camera, joint angle
robot parts in correct with parts; bins sensors
bins
Refinery Purity, yield, Refinery, Valves, pumps, heaters, Temperature, pressure,
controller safety operators displays chemical sensors

38
Specifying the task Environment
➢ Examples of agent types and their PEAS descriptions

Agent Type Performance Environment Actuators Sensors


Medical Healthy patient, Patient, hospital, Display of questions, Keyboard entry of
diagnosis system reduced costs staff tests, diagnoses, symptoms, findings,
treatments, Referrals patient’s Answers
Satellite image Correct image Downlink from Display of scene Color pixel arrays
analysis system categorization orbiting satellite categorization
Part-picking Percentage of Conveyor belt Jointed arm and hand Camera, joint angle
robot parts in correct with parts; bins sensors
bins
Refinery Purity, yield, Refinery, Valves, pumps, heaters, Temperature, pressure,
controller safety operators displays chemical sensors
Interactive Student’s score Set of students, Display of exercises, Keyboard entry
English tutor on test testing agency suggestions,
Corrections
39
Specifying the task Environment
➢ Examples of agent types and their PEAS descriptions

Agent Type Performance Environment Actuators Sensors

40
Specifying the task Environment
➢ Examples of agent types and their PEAS descriptions

Agent Type Performance Environment Actuators Sensors


Playing Tennis Scoring, Stamina, Players, Referees, Strength, Stamina, Eyes, Skill,
Team work, Crowd, Net, Court, Coordination Footwork
Strategy Ball

41
Specifying the task Environment
➢ Examples of agent types and their PEAS descriptions

Agent Type Performance Environment Actuators Sensors


Playing Tennis Scoring, Stamina, Players, Referees, Strength, Stamina, Eyes, Skill,
Team work, Crowd, Net, Court, Coordination Footwork
Strategy Ball
Practicing Tennis Stamina, lowering, Player, Wall, Stance, racket, Eyes, Skill,
missed balls Racket, Ball placement, speed Footwork

42
Specifying the task Environment
➢ Examples of agent types and their PEAS descriptions

Agent Type Performance Environment Actuators Sensors


Playing Tennis Scoring, Stamina, Players, Referees, Strength, Stamina, Eyes, Skill,
Team work, Crowd, Net, Court, Coordination Footwork
Strategy Ball
Practicing Tennis Stamina, lowering, Player, Wall, Stance, racket, Eyes, Skill,
missed balls Racket, Ball placement, speed Footwork
High Jump Form, Height, Height bar, Padded Speed, form, leg, Eyes, Touch
Landing Mat, Judge, Field strength, flexibility

43
Specifying the task Environment
➢ Examples of agent types and their PEAS descriptions

Agent Type Performance Environment Actuators Sensors


Playing Tennis Scoring, Stamina, Players, Referees, Strength, Stamina, Eyes, Skill,
Team work, Crowd, Net, Court, Coordination Footwork
Strategy Ball
Practicing Tennis Stamina, lowering, Player, Wall, Stance, racket, Eyes, Skill,
missed balls Racket, Ball placement, speed Footwork
High Jump Form, Height, Height bar, Padded Speed, form, leg, Eyes, Touch
Landing Mat, Judge, Field strength, flexibility
Knitting a Correct dimension, Yarn, Needles, Speed, Yarn Type, Eyes, hands
Sweater reducing mistakes Instructions, Room sweater size, precision

44
Specifying the task Environment
➢ Examples of agent types and their PEAS descriptions

Agent Type Performance Environment Actuators Sensors


Playing Tennis Scoring, Stamina, Players, Referees, Strength, Stamina, Eyes, Skill,
Team work, Crowd, Net, Court, Coordination Footwork
Strategy Ball
Practicing Tennis Stamina, lowering, Player, Wall, Stance, racket, Eyes, Skill,
missed balls Racket, Ball placement, speed Footwork
High Jump Form, Height, Height bar, Padded Speed, form, leg, Eyes, Touch
Landing Mat, Judge, Field strength, flexibility
Knitting a Correct dimension, Yarn, Needles, Speed, Yarn Type, Eyes, hands
Sweater reducing mistakes Instructions, Room sweater size, precision
Auction Bidding Winning, Paying Opponents, item, Budget, item value, Eyes, Ears, Mouth,
lowest price Auctioneer eagerness Knowledge of item

45
Properties of Task Environment

➢ An environment is everything in the world which surrounds the agent, but it is not a part of an agent itself. An
environment can be described as a situation in which an agent is present. The environment is where agent
lives, operate and provide the agent with something to sense and act upon it.

❑ Fully observable vs Partially Observable


❑ Static vs Dynamic
❑ Discrete vs Continuous
❑ Deterministic vs Stochastic
❑ Single-agent vs Multi-agent
❑ Episodic vs sequential
❑ Known vs Unknown
❑ Accessible vs Inaccessible

46
Properties of Task Environment

➢ Fully observable vs Partially observable

❑ If an agent sensor can sense or access the complete state of an environment at each point of time
then it is a fully observable environment, else it is partially observable.

❑ A fully observable environment is easy as there is no need to maintain the internal state to keep
track history of the world.

❑ An agent with no sensors in all environments then such an environment is called


as unobservable.

47
Properties of Task Environment

➢ Static vs Dynamic

❑ If the environment can change itself while an agent is deliberating then such environment is
called a dynamic environment else it is called a static environment.

❑ Static environments are easy to deal because an agent does not need to continue looking at
the world while deciding for an action.

❑ However for dynamic environment, agents need to keep looking at the world at each action.

❑ Taxi driving is an example of a dynamic environment whereas Crossword puzzles are an example
of a static environment.

48
Properties of Task Environment

➢ Discrete vs Continuous

❑ If in an environment there are a finite number of percepts and actions that can be performed
within it, then such an environment is called a discrete environment else it is called continuous
environment.

❑ A chess game comes under discrete environment as there is a finite number of moves that can be
performed.

❑ A self-driving car is an example of a continuous environment.

49
Properties of Task Environment

➢ Deterministic vs Stochastic

❑ If an agent's current state and selected action can completely determine the next state of the
environment, then such environment is called a deterministic environment.

❑ A stochastic environment is random in nature and cannot be determined completely by an


agent.

❑ In a deterministic, fully observable environment, agent does not need to worry about uncertainty.

50
Properties of Task Environment

➢ Single-agent vs Multi-agent

❑ If only one agent is involved in an environment, and operating by itself then such an
environment is called single agent environment.

❑ However, if multiple agents are operating in an environment, then such an environment is called
a multi-agent environment.

❑ The agent design problems in the multi-agent environment are different from single agent
environment.

51
Properties of Task Environment

➢ Episodic vs sequential

❑ In an episodic environment, there is a series of one-shot actions, and only the current percept
is required for the action.

❑ However, in Sequential environment, an agent requires memory of past actions to determine


the next best actions.

52
Properties of Task Environment

➢ Known vs Unknown

❑ Known and unknown are not actually a feature of an environment, but it is an agent's state of
knowledge to perform an action.

❑ In a known environment, the results for all actions are known to the agent. While in unknown
environment, agent needs to learn how it works in order to perform an action.

❑ It is quite possible that a known environment to be partially observable and an Unknown


environment to be fully observable.

53
Properties of Task Environment

➢ Accessible vs Inaccessible

❑ If an agent can obtain complete and accurate information about the state's environment, then
such an environment is called an Accessible environment else it is called inaccessible.

❑ An empty room whose state can be defined by its temperature is an example of an accessible
environment.

❑ Information about an event on earth is an example of Inaccessible environment.

54
Properties of Task Environment

➢ Examples of task environments and their characteristics

Task Observable Agents Deterministic Episodic Static Discreate

55
Properties of Task Environment

➢ Examples of task environments and their characteristics

Task Observable Agents Deterministic Episodic Static Discreate


Crossword Puzzle Fully Single Deterministic Sequential static Discrete

56
Properties of Task Environment

➢ Examples of task environments and their characteristics

Task Observable Agents Deterministic Episodic Static Discreate


Crossword Puzzle Fully Single Deterministic Sequential static Discrete
Chess with a Clock Fully Multi Deterministic Sequential Static Discrete

57
Properties of Task Environment

➢ Examples of task environments and their characteristics

Task Observable Agents Deterministic Episodic Static Discreate


Crossword Puzzle Fully Single Deterministic Sequential static Discrete
Chess with a Clock Fully Multi Deterministic Sequential Static Discrete
Poker Partially Multi Stochastic Sequential Static Discrete

58
Properties of Task Environment

➢ Examples of task environments and their characteristics

Task Observable Agents Deterministic Episodic Static Discreate


Crossword Puzzle Fully Single Deterministic Sequential static Discrete
Chess with a Clock Fully Multi Deterministic Sequential Static Discrete
Poker Partially Multi Stochastic Sequential Static Discrete
Backgammon Fully Multi Stochastic Sequential Static Discrete

59
Properties of Task Environment

➢ Examples of task environments and their characteristics

Task Observable Agents Deterministic Episodic Static Discreate


Crossword Puzzle Fully Single Deterministic Sequential static Discrete
Chess with a Clock Fully Multi Deterministic Sequential Static Discrete
Poker Partially Multi Stochastic Sequential Static Discrete
Backgammon Fully Multi Stochastic Sequential Static Discrete
Taxi Driving Partially Multi Stochastic Sequential Dynamic Continuous

60
Properties of Task Environment

➢ Examples of task environments and their characteristics

Task Observable Agents Deterministic Episodic Static Discreate


Crossword Puzzle Fully Single Deterministic Sequential static Discrete
Chess with a Clock Fully Multi Deterministic Sequential Static Discrete
Poker Partially Multi Stochastic Sequential Static Discrete
Backgammon Fully Multi Stochastic Sequential Static Discrete
Taxi Driving Partially Multi Stochastic Sequential Dynamic Continuous
Medical Diagnosis Partially Single Stochastic Sequential Dynamic Continuous

61
Properties of Task Environment

➢ Examples of task environments and their characteristics

Task Observable Agents Deterministic Episodic Static Discreate


Crossword Puzzle Fully Single Deterministic Sequential static Discrete
Chess with a Clock Fully Multi Deterministic Sequential Static Discrete
Poker Partially Multi Stochastic Sequential Static Discrete
Backgammon Fully Multi Stochastic Sequential Static Discrete
Taxi Driving Partially Multi Stochastic Sequential Dynamic Continuous
Medical Diagnosis Partially Single Stochastic Sequential Dynamic Continuous
Image Analysis Fully Single Deterministic Episodic Static Continuous

62
Properties of Task Environment

➢ Examples of task environments and their characteristics

Task Observable Agents Deterministic Episodic Static Discreate


Crossword Puzzle Fully Single Deterministic Sequential static Discrete
Chess with a Clock Fully Multi Deterministic Sequential Static Discrete
Poker Partially Multi Stochastic Sequential Static Discrete
Backgammon Fully Multi Stochastic Sequential Static Discrete
Taxi Driving Partially Multi Stochastic Sequential Dynamic Continuous
Medical Diagnosis Partially Single Stochastic Sequential Dynamic Continuous
Image Analysis Fully Single Deterministic Episodic Static Continuous
Part-picking Robot Partially Single Stochastic Episodic Dynamic Continuous

63
Properties of Task Environment

➢ Examples of task environments and their characteristics

Task Observable Agents Deterministic Episodic Static Discreate


Crossword Puzzle Fully Single Deterministic Sequential static Discrete
Chess with a Clock Fully Multi Deterministic Sequential Static Discrete
Poker Partially Multi Stochastic Sequential Static Discrete
Backgammon Fully Multi Stochastic Sequential Static Discrete
Taxi Driving Partially Multi Stochastic Sequential Dynamic Continuous
Medical Diagnosis Partially Single Stochastic Sequential Dynamic Continuous
Image Analysis Fully Single Deterministic Episodic Static Continuous
Part-picking Robot Partially Single Stochastic Episodic Dynamic Continuous
Refinery Controller Partially Single Stochastic Sequential Dynamic Continuous

64
Properties of Task Environment

➢ Examples of task environments and their characteristics

Task Observable Agents Deterministic Episodic Static Discreate


Crossword Puzzle Fully Single Deterministic Sequential static Discrete
Chess with a Clock Fully Multi Deterministic Sequential Static Discrete
Poker Partially Multi Stochastic Sequential Static Discrete
Backgammon Fully Multi Stochastic Sequential Static Discrete
Taxi Driving Partially Multi Stochastic Sequential Dynamic Continuous
Medical Diagnosis Partially Single Stochastic Sequential Dynamic Continuous
Image Analysis Fully Single Deterministic Episodic Static Continuous
Part-picking Robot Partially Single Stochastic Episodic Dynamic Continuous
Refinery Controller Partially Single Stochastic Sequential Dynamic Continuous
Interactive Tutor Partially Multi Stochastic Sequential Dynamic Discrete
65
Part - IV
The Structure of Agents

66
The Structure of Agents

➢ So far we have talked about agents by describing behavior—the action that is performed after any given
sequence of percepts.

➢ Now we will talk about how the insides work

❑ The job of AI is to design an agent program that implements the agent function-the mapping
from percepts to actions.

➢ We assume this program will run on some sort of computing device with physical sensors and actuators—we
call this the architecture:
Agent = Architecture + Program
➢ Obviously, the program we choose has to be one that is appropriate for the architecture.
❑ If the program is going to recommend actions like Walk, the architecture had better have legs.

➢ In general, the architecture makes the percepts from the sensors available to the program, runs the program,
and feeds the program’s action choices to the actuators as they are generated.
67
Agent Programs

➢ Agent programs take the current percept as input from the sensors and return an action to the actuators.

❑ The agent program, which takes the current percept as input, and the agent function, which
takes the entire percept history.

➢ The agent program takes just the current percept as input because nothing more is available from the
environment; if the agent’s actions need to depend on the entire percept sequence, the agent will have to
remember the percepts.

68
Kinds of Agent Programs

➢ The four basic kinds of agent programs that embody the principles underlying almost all intelligent systems.

❑ Simple reflex agents

❑ Model-based reflex agents

❑ Goal-based agents

❑ Utility-based agents

➢ Each kind of agent program combines particular components in particular ways to generate actions.

69
Simple reflex agents

➢ The simplest kind of agent is the simple reflex agent. These agents select actions on the basis of the
current percept, ignoring the rest of the percept history.

➢ A simple reflex agent. It acts according to a rule


whose condition matches the current state, as
defined by the percept.
Schematic diagram of a simple reflex agent.
70
Model-based reflex agents

➢ The most effective way to handle partial observability is for the agent to keep track of the part of the world it
can’t see now.

➢ That is, the agent should maintain some sort of internal state that depends on the percept history and
thereby reflects at least some of the unobserved aspects of the current state.

➢ Updating this internal state information as time goes by requires two kinds of knowledge to be encoded in the
agent program.

❑ First, we need some information about how the world evolves independently of the agent

❑ Second, we need some information about how the agent’s own actions affect the world

➢ This knowledge about “how the world works”—whether implemented in simple Boolean circuits or in
complete scientific theories—is called a model of the world. An agent that uses such a model is called a
model-based agent.

71
Model-based reflex agents

➢ A model-based reflex agent. It keeps track of the current


state of the world, using an internal model. It then chooses
A model-based reflex agent an action in the same way as the reflex agent.

➢ Update-state is responsible for creating the new internal state description. The details of how models and
states are represented vary widely depending on the type of environment and the particular technology used
in the agent design

72
Goal-based agents

➢ Knowing something about the current state of the environment is not always enough to decide what to do.

➢ At a road junction, the taxi can turn left, turn right, or go straight on. The correct decision depends on
where the taxi is trying to get to

➢ In other words, as well as a current state description, the agent needs some sort of goal information that
describes situations that are desirable—for example, being at the passenger’s destination

➢ The agent program can combine this with the to choose actions that achieve the goal.

73
Goal-based agents

A goal-based agent. It keeps track of the world state as well as a set of goals it is trying to achieve, and
chooses an action that will (eventually) lead to the achievement of its goals.

74
Utility-based agents

➢ Goals alone are not enough to generate high-quality behavior in most environments.

➢ For example, many action sequences will get the taxi to its destination (thereby achieving the goal) but some
are quicker, safer, more reliable, or cheaper than others.

➢ Goals just provide a crude binary distinction between “happy” and “unhappy” states.

➢ A more general performance measure should allow a comparison of different world states according to
exactly how happy they would make the agent.

➢ Because “happy” does not sound very scientific, economists and computer scientists use the term utility (the
quality of being useful) instead.

➢ An agent’s utility function is essentially an internalization of the performance measure. If the internal utility
function and the external performance measure are in agreement, then an agent that chooses actions to
maximize its utility will be rational according to the external performance measure.

75
Utility-based agents

A utility-based agent. It uses a model of the world, along with a utility function that measures its preferences
among states of the world. Then it chooses the action that leads to the best expected utility, where expected utility
is computed by averaging over all possible outcome states, weighted by the probability of the outcome.

76
77
Part - V
Knowledge-Based Agents

78
Knowledge-Based Agents

➢ Humans, it seems, know things; and what they know helps them do things.

➢ They make strong claims about how the intelligence of humans is achieved—not by purely reflex mechanisms
but by processes of reasoning that operate on internal representations of knowledge.

➢ In AI, this approach to intelligence is embodied in knowledge-based agents.

➢ The central component of a knowledge-based agent is its knowledge base i.e. a set of sentences

➢ Each sentence is expressed in a language called a knowledge representation language and represents
some assertion about the world.

79
Learning Agents

➢ A learning agent can be divided into four conceptual components.

➢ The most important distinction is between the


learning element, which is responsible for making
improvements, and the performance element,
which is responsible for selecting external actions.

➢ The performance element is what we have


previously considered to be the entire agent: it takes
in percepts and decides on actions.

➢ The learning element uses feedback from the critic


on how the agent is doing and determines how the
performance element should be modified to do
better in the future.

80
81
Summary
➢ The major points to recall are as follows:

❑ An agent and agent function


❑ Performance measure
❑ Rational agent
❑ Task environment.
❑ Agent program
❑ Simple reflex agents
❑ Model-based reflex agents
❑ Goal-based agents
❑ Utility-based agents
❑ Knowledge-based and learning agents.

82

You might also like