Lecture 2 - Agents
Lecture 2 - Agents
Intelligent Agents
Environment
o General AI techniques for a variety of Sensors
Percepts
Agent
problem types
o Learning to recognize when and how a ?
new problem can be solved with an
existing technique Actuators
Actions
Pac-Man as an Agent
Agent Environment
Sensors Percepts
?
Actuators Actions
Pac-Man is a registered trademark of Namco-Bandai Games, used here for educational purposes
Agents
• An agent is anything that can be viewed as perceiving its
environment through sensors and acting upon that
environment through actuators – Norvig&Russell
• 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
– various motors for actuators
Another Definition of Agents
• No single, common definition for concept „Agent“.
Example for controversy: learning ability (adaptability):
May not be desired in e.g. flight control system.
• Woolridge [1]: „An agent is a computer system that is
situated in some environment, and that is capable of
autonomous action in this environment in order to meet
its objectives“
• Sometimes required / demanded: Mobility (in real or
virtual environments), Veracity (Agent will not
communicate wrong information), Benevolence (no
conflicts, fulfillment of all goals will be tried)
• goal orientation is sometimes called Rationality.
(Controversial. Compare 1.4)
Simple Agent Schema & Example
Agent
Sensor Action
Input Output
Environment
o Extremes
o No autonomy – ignores environment/data
o Complete autonomy – must act randomly/no program
o Example: baby learning to crawl
o Ideal: design agents to have some autonomy
o Possibly become more autonomous with experience
PEAS Model
• PEAS: Performance measure, Environment, Actuators, Sensors
• Must first specify the setting for intelligent agent design
• Consider, e.g., the task of designing 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
– Sensors: Cameras, sonar, speedometer, GPS, odometer,
engine sensors, keyboard
PEAS Example I
Cross Word Poker Backgammon Taxi driver Part picking robot Image analysis
Deterministic Stochastic Stochastic Stochastic Stochastic Deterministic
Episodic (vs. sequential):
Cross Word Poker Backgammon Taxi driver Part picking robot Image analysis
Sequential Sequential Sequential Sequential Episodic Episodic
Static (vs. dynamic):
Benign vs Adversarial
o Static environments don’t change
o While the agent is deliberating over what to do
o Dynamic environments do change
o So agent should/could consult the world when choosing actions
o Alternatively: anticipate the change during deliberation OR make decision very
fast
o Semidynamic: If the environment itself does not change with the
passage of time but the agent's performance score does.
Cross Word Poker Backgammon Taxi driver Part picking robot Image analysis
Static Static Static Dynamic Dynamic Semi
Cross Word Poker Backgammon Taxi driver Part picking robot Image analysis
Discrete Discrete Discrete Continuous Continuous Continuous
Single agent (vs. multiagent):
Cross Word Poker Backgammon Taxi driver Part picking robot Image analysis
Single Multi Multi Multi Single Single
Summary.
Fully
Observable
yes
no
Deterministic no
yes
Certainty: Uncertainty
Search
Agent types
o Four basic types in order of
increasing generality:
o Simple reflex agents
o Reflex agents with state/model
o Goal-based agents
o Utility-based agents
o All these can be turned into learning
agents
o https://github.com/aimacode/aima-java/
Simple reflex agents
Simple reflex agents
o Simple but very limited intelligence.
o Action does not depend on percept history, only on current
percept.
o Therefore no memory requirements.
o Infinite loops
o Suppose vacuum cleaner does not observe location. What do you do
given location = clean? Left of A or right on B -> infinite loop.
o Fly buzzing around window or light.
o Possible Solution: Randomize action.
o Thermostat.
o Chess – openings, endings
o Lookup table (not a good idea in general)
o 35100 entries required for the entire game
States: Beyond Reflexes
• Recall the agent function that maps from percept histories to
actions:
[f: P* A]
o An agent program can implement an agent function by
maintaining an internal state.
o The internal state can contain information about the state of
the external environment.
o The state depends on the history of percepts and on the
history of actions taken:
[f: P*, A* S A] where S is the set of states.
o If each internal state includes all information relevant to
information making, the state space is Markovian.
States and Memory: Game Theory
you right
Model base agents update their
state
Goal-based agents
Performance element
is what was previously
the whole agent
Input sensor
Output action
Learning element
Modifies
performance
element.
Learning agents
Problem generator
Tries to solve the
problem differently
instead of
optimizing.
Suggests exploring
new actions -> new
problems.
Learning agents(Taxi driver)
o Performance element
o How it currently drives
o Taxi driver Makes quick left turn across 3 lanes
o Critics observe shocking language by passenger and other
drivers and informs bad action
o Learning element tries to modify performance elements for
future
o Problem generator suggests experiment out something
called Brakes on different Road conditions
o Exploration vs. Exploitation
o Learning experience can be costly in the short run
o shocking language from other drivers
o Less tip
o Fewer passengers
The Big Picture:
AI for Model-Based
Agents
Planning
Decision Theory Action Reinforcement
Game Theory Learning
Knowledg Learnin
e
Logic Machine Learningg
Probability Statistics
Heuristics
Inference
The Picture for Reflex-Based Agents
Actio
n Reinforcement
Learning
Learnin
g
• Studied in AI, Cybernetics, Control Theory,
Biology, Psychology.
Discussion Question
o Model-based behaviour has a large overhead.
o Our large brains are very expensive from an
evolutionary point of view.
o Why would it be worthwhile to base behaviour on a
model rather than “hard-code” it?
o For what types of organisms in what type of
environments?
Agents acting in an environment:
inputs and output