Chapter 2: Intelligent Agents
Recall the focus of the course:
- AI as the study of constructing systems that act
rationally.
- More practical than the study of "rational
thought"
- More general and easier to evaluate than the
study of "human-like" thought and action.
Focus of this lecture:
- The definition of an agent.
- The interaction between agent design and the
environment that the agent must operate in.
- The question of empirical validation.
Key terms:
- Architecture
- Perceptions --- sensors
- Actions --- effectors
- Program
- Environments:
- accessibility
- deterministic
- episodic
- static
What are agents:
- Agent = Architecture + Program
- Here we focus on the Program
- Types of Agents:
- reflex
- goal-based
- utility-based
Goal:
- Design agents that "do the right things," but what
does this mean?
The question of empirical validation:
- Given options, the agent should choose those that
are best for success
- Need an objective performance measure ---can't
just ask the agent or its designer.
- Example criteria (may be conflicting):
- success at job?
- resources consumed?
- time taken?
The measure of success (rationality) must depend on
knowledge; can't require omniscience.
What is rational at any given time depends on 4 things:
1.The performance measure
2.The percept sequence --- the complete perceptual history
of the agent so far
3.Whatever built-in knowledge the agent has
4.The actions that the agent can perform
The ideal rational agent: does the action that is expected to
maximizes the performance measure on the basis of the
built-in knowledge and the percept sequence
- This can include doing actions to obtain more
information
Autonomy:
- A system is autonomous to the extent that its
behavior is determined by its own experiences
- It is reasonable to provide an agent with some
initial knowledge as well as the ability to learn
Agent Design --- the agent program:
- An agent program maps from percept sequences to
actions; the mapping may be simple or more
typically very complex
- The architecture determines the range of possible
percepts or actions
- The agent gets one percept at a time; the internal
state can "remember" the past states, but not a
total record (Why?)
- The goal or performance measure is not part of the
skeleton program
Mapping from percepts to actions by table lookup:
- Uses entire percept sequence as an index into a
table which contains the appropriate action
- problems with this approach:
- the size of the table
- no autonomy
function: Table-Drive-Agent(percept) returns action
static: percepts, a sequence, initially empty
table: a table, indexed by percept sequences, initially
fully specified
append percept to the end of percepts
action <- Lookup(percept, table)
return action
Figure 2.5
Example: navigating while shopping
- reflex agents: stores floor plan pre-compiled in
memory
- goal-based agent: creates an internal map; can
adapt to unexpected changes
- utility-based agent: creates an internal map; can
adapt to unexpected changes in a manner that
maximizes the expected benefit
Simple Reflex Agent:
- condenses input sequence by noting commonly
occurring patterns of input/output
- these patterns are expressed in terms of
"conditional-action" rules
- e.g., if <percept> than <action>
- keeps no internal record of the state of the
environment
function: Simple-Reflex-Agent (percept) returns action
static: rules, a set of condition-action-rules
state <- Interpret-Input(percept)
rule <- Rule-Match(state, rules)
action <- Rule-Action[rule]
return action
Figure 2.8
Reflex Agent with Internal State
- Maintains an internal state to distinguish between
world states that generate the same percept but are
different (because of past actions) with respect to
the action to be taken.
- Requires the ability to represent change in the
world
function: Reflex-Agent-With-State (percept) returns action
static: state, a description of the current world state
rules, a set of condition-action-rules
state <- Update-State(state, percept)
rule <- Rule-Match(state, rules)
action <- Rule-Action[rule]
state <- Update-State(state, action)
return action
Figure 2.10
Goal-Based Agent
- Contains some sort of goal information and
knowledge about the results of possible actions
performs the action or action sequence that
achieves the goals
- See Fig 2.11 in text
Utility-Based Agent
- Goals designate desired states
- Utilities indicate preferences among states
- Particularly useful when:
- i. there are conflicting goals
- ii. no goal state can be achieved with certainty
Examples of different types of agents: See Fig 2.3 in text
Connection to search and knowledge representation:
- Goal and utility-based agents require knowledge
about:
- world states
- actions and effects
- goals and utilities
- Systems must reason with this knowledge; this
process can be viewed as search
Environment properties (depends on how conceptualized)
1.Accessibility
2.Deterministic
3.Episodic vs. non-episodic
4.static vs. dynamic: will the world change while thinking
5.discrete: a finite number of percepts and actions
Accessibility?
- Accessible if sensors give all (relevant) information
(if not accessible, then need some from the internal
state "model")
- Example
- (accessible): chess
- (not accessible): medical diagnosis
Deterministic? The next state is completely defined by the
current state and the agent's actions.
- An environment may seem non-deterministic when
you just can't "see" what's effecting change;
depends on Accessibility
- Example
- (deterministic): chess
- (not deterministic): dice
Episodic vs. non-episodic:
- Choices are local to each time slice; don't need to
think ahead
- Example
- (episodic): robot part checker
Static vs. dynamic:
- will the world change while thinking
- Examples
- (static): chess, poker
- (dynamic): robot part checker, most of real
life
- Semi-dynamic: world doesn't change but time costs
Discrete:
- a finite number of precepts and actions
- Examples: games, most "models" of real life
Summary of Agents
- 3 major types of agents:
- reflex
- goal-based
- utility-based
- the choice of agent depends on:
- the architecture
- goals
- the environment
- the performance measure
- Knowledge Representation: the representation of
the information required by the agents; i.e., world
states, actions and effects, goals and utilities
- Search: apply reasoning procedures to knowledge
in "search" of the goal
Web site to check:
Homework:
- Read section 6.2 of your text describing the
Wumpus world environment.
- Describe the Wumpus World environment in terms
of the 5 properties listed above:
- Accessibility
- Deterministic
- Episodic vs. non-episodic
- static vs. dynamic: will the world change
while thinking
- discrete: a finite number of percepts and
actions
- Discuss the appropriateness of each of the 3 major
agent types for the Wumpus World:
- reflex agent
- goal-based agent
- utility-based agent