You are on page 1of 14

CS 331: Artificial Intelligence

Search

Instructor: Naveed Anwer Butt


Department of Computer Science
University of Gujrat,
Today
 Agents that Plan Ahead

 Search Problems

 Uninformed Search Methods


 Depth-First Search
 Breadth-First Search
 Uniform-Cost Search
Agents that Plan
Reflex Agents

 Reflex agents:
 Choose action based on current percept (and
maybe memory)
 May have memory or a model of the world’s
current state
 Do not consider the future consequences of
their actions
 Consider how the world IS

 Can a reflex agent be rational?

[Demo: reflex optimal (L2D2)]


Video of Demo Reflex Optimal
Video of Demo Reflex Odd
Reflex Agent
 Reflex agents:
 Encounters the same situation has the same reflex,
 repeats over and over and over.
 So this is a reflex agent that's clearly not optimal.
Planning Agents

 Planning agents:
 Ask “what if”
 Decisions based on (hypothesized)
consequences of actions
 Must have a model of how the world evolves in
response to actions
 If No model?
 Must formulate a goal (test)
 Consider how the world WOULD BE

 Optimal vs. complete planning

 Planning vs. replanning


[Demo: replanning (L2D3)]
[Demo: mastermind (L2D4)]
Optimal vs. Complete Planning
 Planning agents:
 Ask Question?
 An algorithm could be optimal or suboptimal
 Optimal means that you achieve goals in minimum cost.
 Complete means that when there exists a solution, you find it.

 planning versus re-planning in the next demo


Video of Demo Mastermind
 It's actually pre-calculating to be ready for planning.
 It's done 1,000 expansions, 2,000 expansions.
 This is reasoning through many possible consequences of actions.
 It's then found what it knows is the optimal sequence of actions to clear
this board.
 And then executes that sequence of actions.
Re-planing
 Sometimes it's not practical to wait this long.
 re-planning
 An agent that doesn't plan an entire sequence ahead of time, but it just
plans to the nearest dot.
 So it checks where is the nearest dot?
 What's my path to get there?
 Executes that plan.
 After it's executed that plan, formulates a new planning problem where it will
plan path to the next nearest dot and repeats over and over and over.
Video of Demo Replanning
References
 Introduction to AI- CS188
 Berkeley University,USA
 http://ai.berkeley.edu
• CS-331 - Introduction to Artificial IntelligenceCS-331 - Prof. Mian
Muhammad Awais
 Lahore University of Lahore, LUMS Pakistan
 http://suraj.lums.edu.pk/~cs331w04/

You might also like