Post on 01-Jan-2016
Intelligent Agents
Chapter 2
CIS 391 - Intro to AI - Fall 2008 2
Outline
Brief Review Agents and environments Rationality PEAS (Performance measure, Environment,
Actuators, Sensors) Environment types Agent types
CIS 391 - Intro to AI - Fall 2008 3
Rational behavior: doing whatever is expected to maximize goal achievement, given the available information
This course is about effective programming techniques for designing rational agents
Review I: AI as Acting Rationally
Thinking humanly Thinking rationally
Acting humanly Acting rationally
CIS 391 - Intro to AI - Fall 2008 4
Review II: Rational agents An agent is an entity that perceives and acts
Abstractly, an agent is a function from percept histories to actions:
[f: P* A]
For any given class of environments and tasks, we seek the agent (or class of agents) with the best performance
CIS 391 - Intro to AI - Fall 2008 5
Agents
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, ...• Actuators: hands, legs, mouth, …
Robotic agent: • Sensors: cameras and infrared range finders • Actuators: various motors
Agents include humans, robots, softbots, thermostats, …
CIS 391 - Intro to AI - Fall 2008 6
Agents and environments
An agent is specified by an agent function f that maps sequences of percepts Y to actions a from a set A:
Y={y0, y1, … , yt}
A={a0, a1, … , ak}
CIS 391 - Intro to AI - Fall 2008 7
Agent function & program
The agent program runs on the physical architecture to produce f• agent = architecture + program
“Easy” solution: table that maps every possible sequence Y to an action a• One small problem: exponential in length of Y
CIS 391 - Intro to AI - Fall 2008 8
Example: A Vacuum-cleaner agent
Percepts: location and contents, e.g., (A,dirty)• (Idealization: locations are discrete)
Actions: move, clean, do nothing:LEFT, RIGHT SUCK NOP
A B
CIS 391 - Intro to AI - Fall 2008 9
Vacuum-cleaner world: agent function
CIS 391 - Intro to AI - Fall 2008 10
Rational agents II
Rational Agent: For each possible percept sequence, a rational agent should select an action that is expected to maximize its performance measure.
Performance measure: An objective criterion for success of an agent's behavior, given the evidence provided by the percept sequence.
A performance measure for a vacuum-cleaner agent might include one or more of:• +1 point for each clean square in time T• +1 point for clean square, -1 for each move• -1000 for more than k dirty squares
CIS 391 - Intro to AI - Fall 2008 11
Rationality is not omniscience Ideal agent: maximizes actual performance, but
needs to be omniscient. • Usually impossible…..
— But consider tic-tac-toe agent…
• Rationality Success
Agents can perform actions in order to modify future percepts so as to obtain useful information (information gathering, exploration)
An agent is autonomous if its behavior is determined by its own experience (with ability to learn and adapt)
CIS 391 - Intro to AI - Fall 2008 12
Task environment
To design a rational agent we need to specify a task environment • a problem specification for which the agent is a solution
PEAS: to specify a task environment• Performance measure
• Environment
• Actuators
• Sensors
CIS 391 - Intro to AI - Fall 2008 13
PEAS: Specifying an automated taxi driver
Performance measure: • ?
Environment: • ?
Actuators: • ?
Sensors: • ?
CIS 391 - Intro to AI - Fall 2008 14
PEAS: Specifying an automated taxi driver
Performance measure: • safe, fast, legal, comfortable, maximize profits
Environment: • ?
Actuators: • ?
Sensors: • ?
CIS 391 - Intro to AI - Fall 2008 15
PEAS: Specifying an automated taxi driver
Performance measure: • safe, fast, legal, comfortable, maximize profits
Environment: • roads, other traffic, pedestrians, customers
Actuators: • ?
Sensors: • ?
CIS 391 - Intro to AI - Fall 2008 16
PEAS: Specifying an automated taxi driver
Performance measure: • safe, fast, legal, comfortable, maximize profits
Environment: • roads, other traffic, pedestrians, customers
Actuators: • steering, accelerator, brake, signal, horn
Sensors: • ?
CIS 391 - Intro to AI - Fall 2008 17
PEAS: Specifying an automated taxi driver
Performance measure: • safe, fast, legal, comfortable, maximize profits
Environment: • roads, other traffic, pedestrians, customers
Actuators: • steering, accelerator, brake, signal, horn
Sensors: • cameras, sonar, speedometer, GPS
CIS 391 - Intro to AI - Fall 2008 18
PEAS: Another example
Agent: Medical diagnosis system
Performance measure: Healthy patient, minimize costs, lawsuits
Environment: Patient, hospital, staff
Actuators: Screen display (form including: questions, tests, diagnoses, treatments, referrals)
Sensors: Keyboard (entry of symptoms, findings, patient's answers)
CIS 391 - Intro to AI - Fall 2008 19
Environment types: Definitions I Fully observable (vs. partially observable): An agent's
sensors give it access to the complete state of the environment at each point in time.
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 deterministic except for the actions of other
agents, then the environment is strategic)
Episodic (vs. sequential): The agent's experience is divided into atomic "episodes" during which the agent perceives and then performs a single action, and the choice of action in each episode depends only on the episode itself.
CIS 391 - Intro to AI - Fall 2008 20
Environment types: Definitions II Static (vs. dynamic): The environment is unchanged while
an agent is deliberating. • The environment is semidynamic 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, clearly defined percepts and actions.
Single agent (vs. multiagent): An agent operating by itself in an environment.
(See examples in AIM, however I don’t agree with some of the judgments)
CIS 391 - Intro to AI - Fall 2008 21
Agent types
Goal of AI: • given a PEAS task environment,
• construct agent function f, • design an agent program that implements f on a
particular architecture
Four basic agent types in order of increasing generality:• Simple reflex• Model-based reflex• Goal-based• Utility-based
CIS 391 - Intro to AI - Fall 2008 22
Simple reflex agent
function REFLEX_VACUUM_AGENT( percept )
returns an action
(location,status) = UPDATE_STATE( percept )
if status = DIRTY then return SUCK;
else if location = A then return RIGHT;
else if location = B then return LEFT;
CIS 391 - Intro to AI - Fall 2008 23
Model-based reflex agents
New
CIS 391 - Intro to AI - Fall 2008 24
Goal-based agents
New
CIS 391 - Intro to AI - Fall 2008 25
Utility-based agents
New
CIS 391 - Intro to AI - Fall 2008 26
Learning agents incorporate others
Any other agent!