Title: Artificial Intelligence
1Artificial Intelligence
- Lecture 13
- Problem Solving Agents
2Overview
- Agent Structure
- Problem Solving Agents
- Problem Types
- Problem Formulation
- Example Problems
3Agent Types
4Agent Types
- Four basic types in order of increasing
generality - Simple reflex agents
- reflex agents with state
- goal-based agents
- utility-based agents
- All these can be turned into learning agents
5Simple Reflex Agent
- Condition Action Rule
- If condition then action
6Simple Reflex Function
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-Actionrule return action
7Reflex Agents with State
8Reflex Function with Internal States
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-Actionrule state ? Update-State(state,
action) return action
9Goal-Based Agents
- Current state information is not enough for
deciding what to do - Also depends on the goal information that
describes the desired outcome
10Utility-Based Agents
- Utility a function that maps a state to a real
value, which describes the degree of
satisfaction.
11Learning Agents
12A Learning Taxi Driver
- Performance element
- Knowledge and procedures for driving
- Learning element
- Formulate goals like learning geography and how
to drive on wet roads - Critic
- Observes the world and passes information to the
learning element - Problem generator
- Try a different route to see if it is quicker
13Problem-solving Agents
14Problem-solving Agents
- Problem-solving agents decide what to do by
finding sequences of actions that lead to
desirable states - Steps in problem solving
- Goal formulation
- Problem formulation
- Searching solutions
- Execution
15Problem-solving Agents
- Assume Offline problem solving
- Solutions executed with eyes closed
- Online problem solving
- Acting without complete knowledge
16Example
- On holiday in romania
- Currently in Arad
- Flights leaves tomorrow from Bucharrest
- Problem-solving
- Formulate goal
- Be in Bucharest
- Formulate problem
- States various cities
- Actions drive between cities
- Find solution
- Sequence of cities, e.g. Arad, sibiu, Fagaras,
Bucharest
17Example Romania
18Problem Types
19Problem Types
- Deterministic, fully observable gt single-state
problem - Agent knows exactly which state it will be in
- Solution is a sequence
- Non-observable gt conformant problem
- Agent may have no idea where it is
- Solution (if any) is a sequence
- Nondeterministic and/or partially observable gt
contingency problem - Percepts provide new information about current
state - Solution is a tree or policy
- Often interleave search, execution
- Unknown state space gt exploration problem
(online problem)
20Example Vacuum World
- Single-state, start in 5, solution?
- Conformant, start in 1,2,3,4,5,6,7,8, solution?
- Contingency, start in 5, solution?
- Murphys law suck can dirty a clean carpet
- Local sensing dirt, location only
21Problem Formulation
22Single-state Problem Formulation
- A problem is defined by four items
- Initial state, e.g. at Arad
- Successor function S(x) set of action-state
pairs, e.g. S(Arad) ltArad-gtZerind, Zerindgt, - Goal test
- Explicit, e.g. x at Bucharest
- Implicit, e.g. NoDirt(x)
- Path cost (additive), e.g. sum of distances,
number of action executed, etc. - C(x,a,y) is the step cost, assumed to be gt 0
- A solution is a sequence of actions leading from
the initial state to a goal state
23Selecting a State Space
- Real world is very complex
- State space must be abstracted for problem
solving - (Abstract) state set of real states
- (Abstract) action complex combination of real
actions - E.g. Arad -gt Zerind represents a complex set of
possible route, detours, rest stops, etc. - For guaranteed realizability, any real state in
Arad must get to some real state in Zerind - (Abstract) soluction set of real paths that are
solutions in the real world - Each abstract action should be easier than the
original problem
24Example Problems
25Example Vacuum World State Space Graph
- States?
- Actions?
- Goal test?
- Path cost?
26Example The 8-Puzzle
- States?
- Actions?
- Goal test?
- Path cost?
27Possible Quiz Questions
- If there is a quiz next time, it might cover
- Difference between reflex agents and goal-based
utility-based agents - Components in a learning agent
- Recognize the environment type
- Relation between environment and agents
- Problem solving steps
- Problem types
- Problem formulation
28Summary
- Agent Structure
- Problem Solving Agents
- Problem Types
- Problem Formulation
- Example Problems