Intelligent Agents Overview by Arslan Shaukat
Intelligent Agents Overview by Arslan Shaukat
Week 2
Intelligent Agents
Omniscience
▪ An omniscience agent knows the actual outcomes of its
actions and can act accordingly
▪ Omniscience is impossible in reality
▪ Road crossing example
1
05-Oct-23
Omniscience - Perfection
▪ Rationality is NOT the same as Perfection
▪ Rationality maximizes expected performance
▪ Perfection maximizes actual performance
Exploration, Learning
▪ Doing actions in order to modify future percepts,
sometimes called information gathering, is an important
part of rationality.
▪ It performs such actions to increase its perception
▪ This is also called Exploration
– as taken by vacuum cleaner agent
▪ A rational agent not only gather information but also
learn as much as possible from what it perceives
2
05-Oct-23
Agent Autonomy
▪ The capacity to compensate for partial or incorrect prior
knowledge by learning
▪ An agent is called autonomous if its behavior is
determined by its own experience (with ability to learn
and adopt)
▪ A truly autonomous agent should be able to operate
successfully in a wide variety of environments
Task Environment
▪ Problems to which rational agents are the solutions.
▪ PEAS
– P – Performance Measure
– E – Environment
– A – Actuators
– S – Sensors
▪ First step in designing an agent must be to define the task
environment
3
05-Oct-23
4
05-Oct-23
PEAS - Example
▪ Automated Taxi Driver Agent
– Performance measure: Safe, correct destination, minimizing fuel
consumption, min wear and tear, fast, legal, comfortable trip, maximize
profit
– Environment: Roads, other traffic, pedestrians, customers, stray animals,
police cars, signals, potholes
– Actuators: Steering, accelerator, brake, signal, horn, display
– Sensors: TV Cameras, sonar, speedometer, accelerometer, GPS, odometer,
engine sensors, keyboard, mic
Medical Diagnostic Healthy patients, Patients, hospital, Display questions, Keyboard entry of
minimize costs, staff tests, diagnoses, symptoms, findings,
treatments, referrals patients’ answers
Satellite image Correct image Downlink from Display Color pixel arrays
analysis system characterization orbiting satellite categorization of
scene
Part picking robot Percentage of parts Conveyor belt with Jointed arm and Cameras, joint angle
in correct bins parts, bins hand sensors
10
5
05-Oct-23
Environment Types
▪ Fully observable vs. partially observable:
– An agent's sensors give it access to the complete state of the
environment at each point in time.
– Partially observable because of noisy and inaccurate sensors
▪ Deterministic vs. stochastic:
– The next state of the environment is completely determined by
the current state and the action executed by the agent.
– If the environment is partially observable, then it could appear
to be stochastic.
▪ Episodic vs. sequential:
– The agent's experience is divided into atomic "episodes" (each
episode consists of the agent perceiving and then performing a
single action)
– choice of action in each episode depends on the past episode.
05/10/2023 11
EC-350 AI and DSS Dr Arslan Shaukat EME (NUST)
11
Environment Types
▪ Static vs. dynamic:
– The environment is unchanged while an agent is deliberating.
– The environment is semi-dynamic if the environment itself does
not change with the passage of time but the agent's
performance score does
▪ Discrete vs. continuous:
– A limited number of distinct states
– Clearly defined percepts and actions.
▪ Single agent vs. multiagent:
– An agent operating by itself in an environment.
– Chess is a competitive multiagent environment.
– Taxi-driving is a partially cooperative multiagent environment.
05/10/2023 EC-350 AI and DSS Dr Arslan Shaukat EME (NUST) 12
12
6
05-Oct-23
13
Structure of Agents
▪ Agent Program
– Implements the agent function— the mapping from percepts to
actions
– Runs on some sort of computing device, we may call it the
architecture
– It may be a plain computer or may include special hardware
14
7
05-Oct-23
Architecture
▪ 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.
▪ The relationship
– Agent = architecture + program
15
Figure: The TABLE DRIVEN AGENT program is invoked for each new
percept and returns an action each time. It retains the complete percept
sequence in memory.
16
8
05-Oct-23
17
Agent Program
▪ The key challenge for AI is to find out how to write
programs that produce rational behavior from a smallish
program rather than from a vast table.
18
9
05-Oct-23
Types of Agents
▪ 5 types:
▪ Simple reflex agents
– respond directly to percepts
▪ Model-based reflex agents
– maintain internal state to track aspects of the world that are not evident in
the current percept.
▪ Goal-based agents
– act to achieve their goals, and
▪ Utility-based agents
– try to maximize their own expected "happiness" or utility
– Utility function
▪ Learning Agents
– Agents can improve their performance through learning
19
20
10
05-Oct-23
21
Goal-based Agents
22
11
05-Oct-23
Utility-based Agents
23
24
12
05-Oct-23
25
Example
▪ On holiday in Romania; currently in Arad.
▪ Flight leaves tomorrow from Bucharest
▪ Formulate goal:
– be in Bucharest
▪ Formulate problem:
– states: various cities
– actions: drive between cities
▪ Find solution:
– sequence of cities, e.g., Arad, Sibiu, Fagaras, Bucharest
26
13
05-Oct-23
27
Example
One possible route
Arad -> Sibiu -> Ramnincu Valcea -> Pitesti -> Bucharest
28
14
05-Oct-23
29
Problem Definition
▪ A Problem can be defined by the following 5
components:
– Initial state defines the start state
– Actions (s) A description of the possible actions available to
the agent. Given a particular state s, ACTIONS(s) returns the
set of actions that can be executed in s
– Transition model/Result (s, a) returns the state that results
from doing action a in state s
30
15
05-Oct-23
31
32
16
05-Oct-23
33
▪ states? The agent is in one of two locations, 2*2*2 = 8 possible world states
▪ initial state: any state can be designated as initial state
▪ Actions (a): {<left>, <right>, <suck>, <noop>}
▪ Result(s,a): <right clean>, <left clean>
▪ goal test: no dirt at all locations
▪ path cost: 1 per action
34
17
05-Oct-23
35
36
18
05-Oct-23
37
38
05/10/2023 EC-350 AI and DSS Dr Arslan Shaukat EME (NUST)
38
19
05-Oct-23
39
05/10/2023 EC-350 AI and DSS Dr Arslan Shaukat EME (NUST)
39
40
05/10/2023 EC-350 AI and DSS Dr Arslan Shaukat EME (NUST)
40
20
05-Oct-23
41
05/10/2023 EC-350 AI and DSS Dr Arslan Shaukat EME (NUST)
41
Fringe
▪ We shall use a data structure called “fringe”
▪ This will contain the collection of nodes which has been
generated but not expanded
▪ The search strategy would decide next node to be
expanded from this list
▪ Assume collection of nodes is represented as a Queue,
Stack etc.
42
21
05-Oct-23
43
44
22