0% found this document useful (0 votes)
19 views

Chapter 2

Uploaded by

bobjan6900
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)
19 views

Chapter 2

Uploaded by

bobjan6900
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/ 32

Artificial

Intelligence
Chapter 2
Intelligent Agents
Agents and environments
 Agent: An agent is anything that can be viewed as perceiving its
environment through sensors and acting upon that environment through
actuators.
 Human agent:
• Sensors: Eyes, ears, and other
• Actuators: Hands, legs, mouth, and other body
 Robotic agent:
• Sensors: Cameras and infrared range finders
• Actuators: Various motors
Agents and environments
 Percept: agent's perceptual inputs.
 Percept sequence: history of what agent
perceived.
 Agent function: maps from percept histories to
actions:

f: P*  A
 The agent program runs on the physical
architecture to produce f.
Vacuum cleaner

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


 Actions: Left, Right, Suck, NoOp
 Examples of agents
• iRobot Roomba series
• https://www.youtube.com/watch?v=edSfq8ItAaI
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.
Rationality: Definition
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."
Omniscience
An omniscient agent:
• knows the actual outcome of its actions and can act
accordingly;
• but omniscience is impossible in reality.
Autonomy
A system is autonomous to the extent that its own
behavior is determined by its own experience and
knowledge.
To survive agents must have:
• Enough built- in knowledge to survive.
• Ability to learn.
Specifying the task environment
 For an agent the task environment is PEAS:
• Performance
• Environment
• Actuators
• Sensors
 In designing an agent:
• The first step must always be to specify the task environment as
fully as possible.
Specifying the task environment
Specifying the task environment
 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, etc…
Obviously, some of these goals conflict, so tradeoffs
will be required.
SOFTWARE AGENT; Softbot
 An agent can be a softbot Web site operator designed to scan
Internet news sources and show the interesting items to its
users, while selling advertising space to generate revenue.
 To do well:
• that operator will need some natural language processing abilities,
• it will need to learn what each user and advertiser is interested in,
• and it will need to change its plans dynamically
• for example, when the connection for one news source goes down
• or when a new one comes online.
Properties of task environments
 The range of task environments that might arise in AI is obviously vast such
as:

 Fully observable vs. partially observable:


• If an agent’s sensors give it access to the complete state of the environment at each
point in time, then we say that the task environment is fully observable.

 Single agent vs. multiagent:


• An agent operating by itself in an environment or several agents

• Multi-agent
• Competitive
• Cooperative
Properties of task environments
 Deterministic vs stochastic
• An environment is deterministic if the next state of the environment is
completely determined by the current state of the environment and the
action of the agent.
• In an accessible and deterministic environment the agent need not deal
with uncertainty.
Properties of task environments
 Episodic vs Sequential:
• In an episodic task environment, the agent’s experience is divided into atomic
episodes.
• An episodic environment means that subsequent episodes do not
depend on what actions occurred in previous episodes.
• Such environments do not require the agent to plan ahead.
 Static vs Dynamic.
• If the environment can change while an agent is deliberating, then we say the
environment is dynamic for that agent; otherwise, it is static.
• In static environments the time it takes to compute a good strategy does not matter.
Properties of task environments
 Discrete vs. continuous:
• The discrete/continuous distinction applies to the state of the
environment, to the way time is handled, and to the percepts and actions
of the agent.
• For example, the chess environment has a finite number of distinct states
• Chess also has a discrete set of percepts and actions.

• Taxi driving is a continuous-state and continuous-time problem:


• the speed and location of the taxi and of the other vehicles sweep through a
range of continuous values and do so smoothly over time.
• Taxi-driving actions are also continuous (steering angles, etc.).
Properties of task environments
 Known vs. unknown:
• Strictly speaking, this distinction refers not to the environment itself but to the
agent’s (or designer’s) state of knowledge about the “laws of physics” of the
environment.
• In a known environment, the outcomes (or outcome probabilities if the environment
is stochastic) for all actions are given.
• Obviously, if the environment is unknown, the agent will have to learn how it works in
order to make good decisions.

 A known environment can be partially observable;


 An unknown environment can be fully observable
• in a new video game, the screen may show the entire game state but I still don’t
know what the buttons do until I try them.
Properties of task environments
The Structure of Agents
 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
• The architecture might be just an ordinary PC, or it might be a
robotic car with several onboard computers, cameras, and other
sensors.
Agent programs
 The agent programs take the percept as input from the sensors
and return an action to the actuators.
• May takes the current percept as input
• May takes the entire percept history as input

 There are other choices for the agent programs too


• for example, we could have the agent programs be coroutines that run
asynchronously with the environment.
• Each such coroutine has an input and output port and consists of a loop
that reads the input port for percepts and writes actions to the output
port.
Agent programs
Types of agent programs
Types of agent programs
 Four basic kinds of agent
programs:
• Simple reflex agents;
• Model-based reflex agents;
• Goal-based agents; and
• Utility-based agents

 Each kind of agent program


combines particular components
in particular ways to generate
actions.
simple reflex agent
 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.
 It acts according to a rule whose
condition matches the current
state, as defined by the percept.
 condition–action rule
• Example:
if car-in-front-is-braking then
initiate-braking
Model-based reflex agents
 It keeps track of the current state of the world,
using an internal model.
 It then chooses an action in the same way as
the reflex agent.
 To update the internal state:
• 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
Goal-based agents
 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.
 in addition to state information they
have a kind of goal information
which describes desirable situations.
 Agents of this kind take future
events into consideration.
Utility-based agents
 Goals alone are not enough to generate The word “utility” here
high-quality behavior in most refers to “the quality of
environments.
• For example, many action sequences will get being useful”
the taxi to its destination (thereby achieving
the goal) but some are quicker, safer, more
reliable, or cheaper than others.
 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.
Learning agents
 The method Turing proposes is to build
learning machines and then to teach
them.
 In many areas of AI, this is now the
preferred method for creating state-of-
the-art systems.
 It allows the agent to operate in initially
unknown environments and to become
more competent than its initial
knowledge alone might allow.
Learning agents
 A learning agent can be divided into
four conceptual components:
 learning element
• responsible for making improvements
 performance element
• responsible for selecting external actions
 critic
• how the agent is doing and determines
how the performance element should be
modified to do better in the future.
 problem generator All agents can improve their
• Responsible for suggesting actions that will performance through
lead to new and informative experiences. learning
How the components of agent
programs work

How the components of agent
programs work
 In an atomic representation each state of the world is indivisible
• A state (such as B or C) is a black box with no internal structure
• search and game-playing algorithms, etc.
 A factored representation splits up each state into a fixed set of variables or
attributes, each of which can have a value.
• Two different factored states can share some attributes (such as being at some
particular GPS location)
• a state consists of a vector of attribute values; values can be Boolean, real-valued, or
one of a fixed set of symbols.
• Planning, machine learning, etc.
 In a structured representation a state includes objects, each of which may
have attributes of its own as well as relationships to other objects.
• knowledge-based learning, natural language understanding, etc.

You might also like