0% found this document useful (0 votes)
7 views37 pages

02-Agents and Environments

Uploaded by

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

02-Agents and Environments

Uploaded by

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

CS3151 – Artificial Intelligence

Instructor: Hafiz Abdul Rehman


Lecture# 02: Intelligent Agents

1
OUTLINE

Agents and Environments


Rationality
PEAS (Performance Measure, Environment, Actuators, Sensors)
Environment Types
Agent types
•An agent is anything that can be viewed as perceiving its
environment through sensors and acting upon that environment
through actuators
Human agent:
• Eyes, ears, and other organs for sensors
• Hands, legs, mouth, and other body parts for actuators
Robotic agent:
• Cameras and infrared range finders for sensors
AGENTS
• Various motors for actuators.
AGENTS AND ENVIRONMENTS

•The agent function maps from percept histories to


actions:
[f: P*  A]
•The agent program runs on the physical architecture to
produce f
• Agent = architecture + program
VACUUM CLEANER WORLD

•Percepts: location and contents, e.g., [A,Dirty]


•Actions: Left, Right, Pick_Dirt, NoOp
RATIONALITY – PERFORMANCE
MEASURE

•An agent should strive to "do the right thing", based on what
it can perceive and the actions it can perform
•The right action is the one that will cause the agent to be
most successful
Priori: something known without experience or sense data
Performance measure: An objective criterion for success of
an agent's behavior
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.
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

We can also use the term “optimizing the performance measure”.

RATIONAL AGENT - ROLE


Rationality Vs Perfection
• Omniscient Agent: state of knowing everything
• Omniscient Agent: knows the actual outcome and act
accordingly
• Rationality: maximize Expected performance
• Perfection: maximize Actual performance
• Rationality doesn’t require omniscience but depends on percept
sequence
• Rationality requires:
1. Information Gathering: to modify future percepts
2. Learning: modify and augment prior knowledge
3. Autonomy: independent from its prior knowledge. (ability
to learn)
8
Task environment: is the problem to which rational
agents are the solutions

Performance measure
Environment
Actuators
Sensors

ENVIRONMENTS
Must - PEASfor intelligent agent
first specify the setting
design
Agent: an automated taxi driver
Performance measure: Safe, fast, legal, comfortable trip,
maximize profits
Environment: Roads, other traffic, pedestrians, customers
Actuators: Steering wheel, accelerator, brake, signal, horn
PEAS -AUTOMATED TAXI DRIVER
Sensors: Cameras, sonar, speedometer, GPS, odometer,
engine sensors, keyboard.
PEAS - MEDICAL DIAGNOSIS SYSTEM

Agent: Medical Diagnosis System


Performance measure: Healthy patient, minimize
costs, lawsuits
Environment: Patient, hospital, staff
Actuators: Screen display (questions, tests, diagnoses,
treatments, referrals)
Sensors: Keyboard (entry of symptoms, findings,
patient's answers).
Agent: Part-picking robot
Performance measure: Percentage of parts in correct
bins
Environment: Conveyor belt with parts, bins
Actuators: Jointed arm and hand
PEAS - PART-PICKING
Sensors: ROBOT
Camera, joint angle sensors.
Agent: Interactive English tutor
Performance measure: Maximize student's score on test
Environment: Set of students
Actuators: Screen display (exercises, suggestions,
corrections)
Sensors: Keyboard.

PEAS - INTERACTIVE ENGLISH TUTOR


ENVIRONMENT TYPES

Fully Observable: An agent's sensors give it access to the


complete state of the environment at each point in time
Agent can be confident that it requires nothing more in
order to decide on the optimal action

PO can be due to faulty sensors


If we are driving along a stretch of road that we know well,
and if dust enters our eyes, we are still able to drive on the
route with blinking eyes (partial observation)
PO requires the agent to have an internal representation of
the state.
ENVIRONMENT TYPES

Single Agent: An agent operating by itself in an environment

Multi-agent case: the performance measure of one agent


depends on the performance measures of the other agent(s)
Competitive multi-agent: Chess Playing
Collaborative multi-agent: Robo Soccer.
A quite complicated field which is currently the focus of
much research. 15
ENVIRONMENT TYPES
Deterministic: The next state of the environment is completely
determined by the current state and the action executed by the
agent

Stochastic: There can be more than one next state, for a given
state-action combination.
Uncertainty about outcomes is quantified in terms of
probabilities
Taxi Driving is clearly stochastic (cannot predict traffic)

Non-Deterministic: actions are characterized by possible


outcomes
Usually associated with performance measure 16
ENVIRONMENT TYPES

Consider a Multi-agent environment

Strategic: If the environment is deterministic except for the


actions of other agents, then the environment is
Strategy Games.

Uncertain: if not fully observable or not deterministic


Usually associated with performance measure
17
ENVIRONMENT TYPES

Episodic: The agent's experience is divided into atomic


"episodes”
Each episode consists of the agent perceiving and then
performing a single action
the choice of action in each episode depends only on the episode
itself
A robot whose job is to detect faulty parts on a line in some
factory

Sequential: current decision can affect all future decisions


In chess, move to execute at each sequential step, in order to win
the game at the end
18
Taxi driver: short term decision and long term consequences
ENVIRONMENT TYPES
Static: The environment is unchanged while an agent is
deliberating which action to execute
Much more simpler to deal with
Crossword puzzle

Dynamic: the agent needs to keep track of the changes in


environment e.g. taxi driver

Semi-dynamic if the environment itself does not change


with the passage of time but the agent's performance score
does,
Chess: when played with clock (checkers)
ENVIRONMENT TYPES

Discrete: if the number of actions and possible states of the


environment is finite (excluding the clock)
Chess
Continuous: if the number of actions and possible states of
the environment are continuous
Taxi driver
Known: the outcome is given for all actions
Solitaire known environment but partially observable
Unknown: agent will learn how to work to make a good
decision
Video game: unknown but fully observable
ENVIRONMENT TYPES
Chess with a clock Chess without a clock Taxi driving

Fully observable Yes Yes No

Deterministic Strategic Strategic No


Episodic No No No
Static Semi Yes No
Discrete Yes Yes No
Single agent No No No

• The environment type largely determines the agent design

• The real world is (of course) partially observable, stochastic, sequential, dynamic,
continuous, multi-agent.
STRUCTURE OF AGENTS

Agent = Agent program + architecture


An agent is completely specified by the agent program
Agent program implements agent function that maps percept sequences to
actions
Can also be labeled as the strategy of the agent
There could be many possible agent functions
Architecture: to run program on some device with physical sensors and
actuators
Aim: Discover the most rational (optimal) agent function.
TABLE-LOOKUP AGENT

Simplest possible agent function:


All possible states and their optimal actions specified by the designers in
advance
Drawbacks:
Huge table (consider continuous states)
Could take a long time to build the table
No autonomy!
Even with learning, agent could need a long time to learn the table entries.
Four basic types of again program in order of increasing generality:
Simple Reflex agents
Model-based Reflex agents
Goal-based agents
Utility-based agents

AGENT PROGRAM TYPES


Learning agents: to improve the performance of above mentioned types in
order to generate better actions
Simple Reflex Agents
• Simple reflex agents select actions based only on the
current percept, ignoring the rest of the percept history.
• Automatic door opening system that opens the door when it
senses a person approaching.

25
SIMPLE REFLEX AGENTS

Applies condition-
action rules based
only on the current
input (reflex)
Automated Taxi:
Agent observes rain falling on the windshield: Agent powers on the viper
Agent observes a red signal; Agent breaks the taxi until it stops.

SIMPLE REFLEX AGENTS


Model-based Reflex agents
• Model-based reflex agents maintain an internal model of
the world, which allows them to consider the history of
percepts.
• Model: how world works: implemented in Boolean circuits
or in complete scientific theories is called Model of the
world.
• These agents utilize a model of the environment to make
decisions, taking into account past perceptions and potential
future states.
• Chess-playing AI that evaluates different moves based on the
current state of the board and predicts future outcomes.

28
MODEL-BASED REFLEX AGENTS

Handles Partial Observability


by creating a model
Goal-based Agents
• Goal-based agents are equipped with goals or objectives
they seek to achieve. They take actions that maximize the
likelihood of reaching these goals.
• These agents assess their actions based on how they
contribute to achieving their predefined goals.
• An autonomous cleaning robot in a household that navigates
through rooms to identify and clean dirty areas, aiming to
achieve the goal of maintaining cleanliness.

30
Along with the model, you need
goals to direct the agent
function.

GOAL-BASED AGENTS
Automated Taxi:
Consider the agent at a crossing, where it can turn right, left, or go straight
Using the model, the Agent can understand the consequences of turning left,
right or going straight ahead
All 3 might seem the optimal actions to take
GOAL-BASED AGENTS
However, the agent needs to select one of these actions in order to reach the
32

destination of the passenger.


Utility-based Agents
• Utility-based agents make decisions by evaluating the
utility or desirability of different actions, aiming to
maximize overall utility.
• These agents assess the desirability of various outcomes and
choose actions that lead to the most favorable overall
outcome.
• A smart thermostat that adjusts temperature settings based on
user preferences, energy efficiency, and comfort levels,
maximizing utility for occupants while minimizing energy
consumption

33
UTILITY-BASED AGENTS

Solves the problem of


conflicting goals, and
quantifies the acquirement
of goal
Automated Taxi:
Consider the agent at a crossing, where it can turn right, left, or go straight
The agent will calculate the utility of each such action
It will select the action which maximizes the utility function, i.e.,
in most cases, the expected profit that the agent can expect to
UTILITY-BASED AGENT
receive in the long run (when the passenger reaches the
destination)
35

E.g., going straight could have highest utility.


Learning Agents
• To build machines and then teach them proposed in paper
(Turing 1950)
• Learning agents improve their performance over time by
learning from experience or from a provided dataset.
• These agents adapt and refine their behavior through experience,
feedback, or training data.
• An image recognition system that learns to classify objects in
images by analyzing a large dataset of labeled images and
adjusting its classification algorithms based on feedback.

36
Thank You!

37

You might also like