You are on page 1of 33

Chapter 2 Lesson 2

Intelligent Agents
Intelligent Agents
2.1. Intelligent Agents
2.2. Agents and Environments
2.3. Acting of Intelligent Agents (Rationality)
2.4. Structure of Intelligent Agents

What is an agent ? 2.5. Agent Types


2.5.1. Simple reflex agent

An agent is anything that 2.5.2. Model-based reflex agent
2.5.3. Goal-based agent

perceiving its environment through sensors and 2.5.4. Utility-based agent
2.5.5. Learning agent

acting upon that environment through actuators

Example:

Human is an agent (has sensor organs: eyes,ears, nose,tongue and skin parallel to sensor, and
hands,legs, mouth for effectors.)

A robot is also an agent with cameras and motors

software agent (has encoded bit string as its program and action.)
Intelligent Agents
Intelligent Agents:
An intelligent agent is an autonomous entity which act upon an environment using
sensors and
actuators for achieving goals. An intelligent agent may learn from the environment to
achieve their
goals. A thermostat is an example of an intelligent agent.
Following are the main four rules for an AI agent:
o Rule 1: An AI agent must have the ability to perceive the environment.
o Rule 2: The observation must be used to make decisions.
o Rule 3: Decision should result in an action.
o Rule 4: The action taken by an AI ag
Intelligent Agents (1)
 Diagram of an agent

What AI should fill


Examples of agent types and their PAGE descriptions.
Agent type Percepts Actions Goals Environment
(input) (output)

Healthy patients,
Medical diagnosis system Symptoms, findings, Questions, tests, treatments minimize costs Patient, hospital
patient's answers

Satellite image analysis Pixels of varying Print a categorization of Correct Images from orbiting
system intensity, color scene categorization satellite

Part-picking robot Pixels of varying Place parts in correct


  intensity Pick up parts and sort into bins bins Conveyor belts with parts

Refinery controller Temperature, Open, close valves; adjust Maximize purity, Refinery
  pressure readings temperature yield, safety  
       

Interactive English tutor Typed words Print exercises, suggestions, Set of students
    corrections Maximize student's  
  score on test  
Questions
Answer 1:
Question 1: Which are agents? (A) : Yes Tsegaye G/Medhin
(A) Tsegaye G/medhin. (B) : Yes your dog
(B) Your dog. (C) : Yes, if it’s an autonomous vacuum cleaner. Else, no.
(C) Vacuum cleaner.

Question 2: Who is rational? Answer 2:


(A) Tsegaye G?medhin,writing a (A) : Depends on whetherreading of book measures his performance.
book without reading. (B) : Depends on whether or not we consider dogs to be able to check the
(B) Your dog, crossing the street traffic. If they can’t, then just running over could be optimal (e.g. to meet
without looking. fellow dogs or grab a sausage).
(C) Vacuum cleaner, deciding to (C) : Yes. (Hypothetical best-case if it’s dirty under your bed, and you’re not
clean under your bed. currently sleeping in it.)
Intelligent Agents(2)
 Simple Terms  Agent function & program
 Percept
 Agent’s perceptual inputs at any given  Agent’s behavior is mathematically
instant described by Agent function
 A function mapping any given
 Percept sequence percept sequence to an action.
 Complete history of everything that the
agent has ever perceived.  Practically it is described by An agent
program
 The real implementation

7
Example 2: The percepts, actions, goals and environment for the taxi
how an agent should act?
Rational Agent:
 A rational agent is an agent which has clear preference, models uncertainty, and acts in a way to maximize its
performance measure with all possible actions.
 A rational agent is said to perform the right things.
 AI is about creating rational agents to use for game theory and decision theory for various real-world scenarios.
 For an AI agent, the rational action is most important because in AI reinforcement learning algorithm, for each best
possible action, agent gets the positive reward and for each wrong action, an agent gets a negative reward.
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 defines the success criterion.
o Agent prior knowledge of its environment.
o Best possible actions that an agent can perform.
o The sequence of percepts.
Note: Rationality differs from Omniscience because an Omniscient agent knows the actual
outcome of its action and act accordingly, which is not possible in reality.
how an agent should act?(1)

 For each possible percept sequence, an rational agent should select an action expected to maximize its
performance measure, given the evidence provided by the percept sequence and whatever built-in knowledge
the agent has

E.g. exam
 Maximize marks, based on the questions on the paper & your knowledge
 An omniscient agent
 Knows the actual outcome of its actions in advance
 No other possible outcomes
 However, impossible in real world
E.g. Example
 Crossing a street but died of the fallen cargo door from 33,000ft  irrational?
Learning

 Does a rational agent depend on only current percept?


 No, the past percept sequence should also be used. this is called
learning

 After experiencing an episode, the agent should adjust its behaviors


to perform better for the same job next time.
Autonomy

 If an agent just relies on the prior knowledge of its designer rather


than its own percepts then the agent lacks autonomy

 A rational agent should be autonomous- it should learn what it can


to compensate for partial or incorrect prior knowledge.
 E.g. a clock
 No input (percepts)
 Run only but its own algorithm (prior knowledge)
 No learning, no experience, etc.
Software Agents

 Sometimes, the environment may not be the real world

 E.g. flight simulator, video games, Internet

 They are all artificial but very complex environments

 Those agents working in these environments are called Software

agent (softbots) Because all parts of the agent are software


Task environments
 Task environments are the problems
 While the rational agents are the solutions

 Specifying the task environment, PEAS description as fully as possible


 Performance measure
 Environment

 Actuators

 Sensors

 In designing an agent, the first step must always be to specify the task environment as
fully as possible.
Task environment (1)

E.g, Automated taxi driver


Task environments (2)
 Performance measure  Actuators
 How can we judge the automated driver?  Control over the accelerator, steering,
 Which factors are considered?
gear shifting and braking
 getting to the correct destination
 minimizing fuel consumption  A display to communicate with the
 minimizing the trip time and/or cost customers
 minimizing the violations of traffic laws
 maximizing the safety and comfort, etc.

 Environment  Sensor
 A taxi must deal with a variety of roads  camera,
 Traffic lights, other vehicles, pedestrians, stray animals,
road works, police cars, etc.
 Interact with the customer
Properties of task environments
 Fully observable vs. Partially observable
 Fully observable
 If an agent’s sensors give it access to the complete state of the environment at each point in time then
the environment is effectively and fully observable
 Partially observable
 If an agent’s sensors doesn't give it access to the complete state of the environment.
 Because of noisy and inaccurate sensors or parts of the state are simply missing from the sensor data.
 E.g. A local dirt sensor of the cleaner cannot tell Whether other squares are clean or not.

 Deterministic vs. stochastic


 Next state of the environment Completely determined by the current state and the actions executed by
the agent, then the environment is deterministic, otherwise, it is Stochastic.
 E.g. Cleaner and taxi driver are: Stochastic because of some unobservable aspects: noise or unknown
Properties of task environments (1)
 Episodic vs. sequential  Static vs. dynamic
 An episode = agent’s single pair of perception  A dynamic environment is always changing over
& action
time
 The quality of the agent’s action does not
depend on other episodes  E.g., the number of people in the street
 Every episode is independent of each other  Static environment
 Episodic environment is simpler  E.g. the destination
 The agent does not need to think ahead
 Semi dynamic
 Sequential
 Current action may affect all future decisions  environment is not changed over time
 E.g. Taxi driving and chess.  but the agent’s performance score does
Properties of task environments (2)
 Discrete vs. continuous  Known vs. unknown
 If there are a limited number of  In known environment, the outcomes for all

distinct states, clearly defined actions are given.

percepts and actions, the  Example: solitaire card games.

environment is discrete
 E.g.Chess game  If the environment is unknown, the agent will
have to learn how it works in order to make
good decisions.
 Continuous environment
 Example: new video game.
 E.g. Taxi driving
Examples of task environments
Structure of agents
2.1. Intelligent Agents
2.2. how an agent should act?
2.4. Structure of Intelligent Agents
2.5. Agent Types
2.5.1. Simple reflex agent

 Agent = architecture + program 2.5.2. Model-based reflex agent


2.5.3. Goal-based agent
2.5.4. Utility-based agent
2.5.5. Learning agent

 Architecture = some sort of computing device (sensors + actuators)


 Program = some function that implements the agent mapping = “?”
 Agent Program = Job of AI
Agent programs
 Input for Agent Program An agent based on a prespecified lookup table.
 Only the current percept
 It keeps track of the percept sequence and
just looks up the best action.

 Input for Agent Function


 The entire percept sequence
 The agent must remember all of them

 Implement the agent program as


 A look up table (agent function)
Types of agent programs

1. Simple reflex agents: These agents take decisions on the basis of the current percepts and ignore the rest of
the percept history. They have very limited intelligence

 Not adaptive to changes in the environment.

 An agent that only bases its actions on the last percept: f a : P → A.

 It uses just condition-action rules


 The rules are like the form “if … then …”
 efficient but have narrow range of applicability
 Because knowledge sometimes cannot be stated explicitly
 Work only: if the environment is fully observable
Simple reflex agent
 It works by finding a rule whose
condition matches the current
situation (as defined by the
percept) and then doing the
action associated with that rule.
 Problem:
 can only react to the
perceived state of the
environment, not the change.
 Partially observable
environments get simple
reflex agents into trouble.
 E.g. Vacuum cleaner robot with
defective location sensor ; in-
finite loops
Model-based Reflex Agents

 Agents that keep track of the world, and the agent is with memory
 A model-based agent has two important factors:
o Model: It is knowledge about "how things happen in the world," so it is called a Model-based agent.
o Internal State: It is a representation of the current state based on percept history.
 These agents have the model, "which is knowledge of the world" and based on the model.
they perform actions
 For the world that is partially observable the agent has to keep track of an internal state
 That depends on the percept history, and reflecting some of the unobserved aspects
 E.g. driving a car and changing lane
 Updating the agent state requires two types of knowledge (information) about:

 How the world evolves independently of the agent


 How the agent’s actions affect the world
Model-based Reflex Agents (1)
Goal-based agents

 an agent performs the action based on  Goal-based agents are less efficient

goals and world model.  but more flexible

 Observation: Having a goal in mind  Agent  Different goals  different tasks

does (determines future actions)  Search and planning

 Current state of the environment is  to find out the action sequences to achieve its goal

They choose an action, so that they can achieve the goal.


always not enough
These agents may have to consider a long sequence of
 Actions chosen  goals, based on possible actions before deciding whether the goal is achieved or
 the current state not.
 the current percept
Goal-based agents (1)

 Problem: Having a model of


the world does not always
determine what to do.
Utility-based agent
 These agents are similar to the goal-based agent but provide an extra component of utility measurement which
makes them different by providing a measure of success at a given state.

 Acts based not only goals but also the best way to achieve the goal.

 Uses multiple possible alternatives, and an agent has to choose in order to perform the best action.

 It chooses the action that leads to the best expected utility, which is computed by
averaging over all possible outcome states, weighted by the probability of the
outcome.
 E.g. meals in Canteen
 Uses a world model along with utility function that influences its preferences among
the states of that world.
Utility-based agent (1)

Utility has several advantages:


 When there are conflicting goals,
 Only some of the goals but not all can
be achieved
 Utility describes the appropriate trade-
off

 When there are several goals


 None of them are achieved certainly
 Utility provides a way for the decision-
making
Learning Agents
 Is the type of agent which can learn from its past experiences, or it has learning
capabilities.
 Starts to act with basic knowledge and then able to act and adapt automatically through
learning.
 Is an agent that augments the performance element which determines actions from
percept sequences with the following components.
 Has mainly four conceptual components, which are:

 Learning element : makes improvements to the agent’s knowledge


 Critic: gives feedback to the learning element based on an external performance
standard (from user or examples, good or not?)
 Problem generator: suggests actions that lead to new and informative experiences.

Learning Agents (1)
Thank you

You might also like