2 Agents
2 Agents
Santosh Khanal
Today’s Topics
Review of Previous Lecture
Agents
Factors defining Agent
Environment & its types
Agent Architecture
Artificial Intelligence
Views of AI fall into four categories:
Sensors: camera
Percepts: location and contents, e.g., [A,Dirty]
Actions: Left, Right, Suck, NoOp
Rational Agents
"do the right thing”
Example
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.
Environment??
Actuators??
Sensors??
PEAS
Must first specify the setting for intelligent agent
design
Chess without a
clock
Discrete vs.
continuous
Single agent vs.
Environment Examples Environment Obse
rvabl
Determ
inistic
Episodic Stati
c
Discret
e
Agent
s
e
Chess with a clock Fully Strategi Sequentia Semi Discret Multi
c l e
Chess without a Fully Strategi Sequentia Stati Discret Multi
clock c l c e
Poker Partia Strategi Sequentia Stati Discret Multi
l c l c e
Backgammon Fully Stochas Sequentia Stati Discret Multi
Fully observable vs. tic l c e
partially observable Taxi driving Partia Stochas Sequentia Dyna Continu Multi
l tic l mic ous
Deterministic vs.
Medical diagnosis Partia Stochas Episodic Stati Continu Single
stochastic / strategic l tic c ous
Episodic vs. sequential Image analysis Fully Determi Episodic Semi Discret Single
Static vs. dynamic nistic e
continuous
Single agent vs.
Environment Examples Environment Obse
rvabl
Determ
inistic
Episodic Stati
c
Discret
e
Agent
s
e
Chess with a clock Fully Strategi Sequentia Semi Discret Multi
c l e
Chess without a Fully Strategi Sequentia Stati Discret Multi
clock c l c e
Poker Partia Strategi Sequentia Stati Discret Multi
l c l c e
Backgammon Fully Stochas Sequentia Stati Discret Multi
Fully observable vs. tic l c e
partially observable Taxi driving Partia Stochas Sequentia Dyna Continu Multi
l tic l mic ous
Deterministic vs.
Medical diagnosis Partia Stochas Episodic Stati Continu Single
stochastic / strategic l tic c ous
Episodic vs. sequential Image analysis Fully Determi Episodic Semi Discret Single
Static vs. dynamic nistic e
Discrete vs. Robot part picking Fully Determi Episodic Semi Discret Single
nistic e
continuous
Single agent vs.
Environment Examples Environment Obse
rvabl
Determ
inistic
Episodic Stati
c
Discret
e
Agent
s
e
Chess with a clock Fully Strategi Sequentia Semi Discret Multi
c l e
Chess without a Fully Strategi Sequentia Stati Discret Multi
clock c l c e
Poker Partia Strategi Sequentia Stati Discret Multi
l c l c e
Backgammon Fully Stochas Sequentia Stati Discret Multi
Fully observable vs. tic l c e
partially observable Taxi driving Partia Stochas Sequentia Dyna Continu Multi
l tic l mic ous
Deterministic vs.
Medical diagnosis Partia Stochas Episodic Stati Continu Single
stochastic / strategic l tic c ous
Episodic vs. sequential Image analysis Fully Determi Episodic Semi Discret Single
Static vs. dynamic nistic e
Discrete vs. Robot part picking Fully Determi Episodic Semi Discret Single
nistic e
continuous
Interactive English
Single agent vs. tutor
Environment Examples Environment Obse
rvabl
Determ
inistic
Episodic Stati
c
Discret
e
Agent
s
e
Chess with a clock Fully Strategi Sequentia Semi Discret Multi
c l e
Chess without a Fully Strategi Sequentia Stati Discret Multi
clock c l c e
Poker Partia Strategi Sequentia Stati Discret Multi
l c l c e
Backgammon Fully Stochas Sequentia Stati Discret Multi
Fully observable vs. tic l c e
partially observable Taxi driving Partia Stochas Sequentia Dyna Continu Multi
l tic l mic ous
Deterministic vs.
Medical diagnosis Partia Stochas Episodic Stati Continu Single
stochastic / strategic l tic c ous
Episodic vs. sequential Image analysis Fully Determi Episodic Semi Discret Single
Static vs. dynamic nistic e
Discrete vs. Robot part picking Fully Determi Episodic Semi Discret Single
nistic e
continuous
Interactive English Partia Stochas Sequentia Dyna Discret Multi
Single agent vs. tutor l tic l mic e
Agent types
Four basic types in order of increasing generality:
SimpleReflexAgent(percept)
state = InterpretInput(percept)
rule = RuleMatch(state, rules)
action = RuleAction(rule) If status=Dirty then return Suck
Return action else if location=A then return
Right
else if location=B then right Left
Model-based reflex agents
• To tackle partially observable
environments.
– Maintain internal state
• Over time update state using
world knowledge
– How does the world
change.
– How do actions affect
world.
Model of World
Model-based reflex agents
Simple Reflex Agent
with Internal State
Store previously-
observed information
Can reason about
unobserved aspects of
current state
ReflexAgentWithState(percept)
state = UpdateDate(state,action,percept)
rule = RuleMatch(state, rules)
action = RuleAction(rule) If status=Dirty then Suck
Return action else if have not visited
other square in >3 time units, go there
Goal-based agents
• The agent needs a goal to
know which situations are
desirable.
– Things become difficult
when long sequences of
actions are required to find
the goal.
• Typically investigated in
search and planning
research.
• Major difference: future is
taken into account
• Is more flexible since
knowledge is represented
explicitly and can be
manipulated.
Utility-based agents
• Certain goals can be
reached in different ways.
– Some are better, have a
higher utility.
• Utility function maps a
(sequence of) state(s) onto
a real number.
• Improves on goals:
– Selecting between
conflicting goals
– Select appropriately
between several goals
based on likelihood of
success.
Learning Agent
Summary: Intelligent Agents
An agent perceives and acts in an environment, has an architecture, and is
implemented by an agent program.
Task environment – PEAS (Performance, Environment, Actuators,
Sensors)
The most challenging environments are inaccessible, nondeterministic,
dynamic, and continuous.
An ideal agent always chooses the action which maximizes its expected
performance, given its percept sequence so far.
An agent program maps from percept to action and updates internal
state.
Reflex agents respond immediately to percepts.
simple reflex agents