intelligent systems (2ii40) c2 alexandra i. cristea september 2005

78
Intelligent Systems (2II40) C2 Alexandra I. Cristea September 2005

Upload: april-caldwell

Post on 02-Jan-2016

215 views

Category:

Documents


1 download

TRANSCRIPT

Intelligent Systems (2II40)C2

Alexandra I. CristeaSeptember 2005

Outline

II. Intelligent agents

III. Search

II. Intelligent agents

1. Rational agent

2. Agent & its environment

3. Example: a simple agent

4. Rationality?

5. Task environment:A. PEAS

B. Properties of the task environment

6. Agent properties

The agent and its environment

• E.g.: humans, robots, softbots but also thermostats

What kind of problem do these funny stories point at?

Rational Agent: Generalities

• We seek agent with best performance for given capabilities:– function from percept history to action:

f: P* -> Af: P* -> A

– environment(s) + task(s)– computational limitations: given machine

resources

Rationality(intelligence?)

Rationality – complete def.

• For each possible percept sequence & For each possible percept sequence & task in a given environment, a rational task in a given environment, a rational agent should select an action that is agent should select an action that is expected to expected to maximize its performance maximize its performance measuremeasure, given the evidence provided by , given the evidence provided by the percept sequence, its resources, its the percept sequence, its resources, its performance measure and whatever built-performance measure and whatever built-in knowledge the agent has.in knowledge the agent has.

Test: Is the agent rational?Test: Is the agent rational?

A.- environment + what is known about the environment?B.- task + what is known about the given task?C.- machine resources + what is known about the given

machine resources?D.- percept sequence + what is known about the precept

sequence up to date?E.- agent actionsF.- is there a performance measure?G.- After the questions above are answered, we have to

check if the performance measure is maximized

What kind of problem do these funny stories point at?

II.5.A. Specifying the task environment: PEASPEAS

The agent and its environment

(Optional homework)

II.5.B. Properties of task environment

II.6. Agent types

Conclusion agents

• Agent is ‘something’ that perceives & acts in an environment.– Extra exercise: find alternative definitions!

• A Rational Agent acts so that it maximizes the performance measure.

• A task environment includes: performance measure, external env., actuators, sensors.

• Basic agent program design: reflex, model/ goal/ utility –based, learning agents

Homework 2 – part I

1. Develop a PEAS description for an automatic bus (e.g., Phileas) a chess playing robot (e.g, Deep Blue) and your own agent; give the proprieties of the task environment for each; select a suitable agent design.

2. Define a rational agent in a limited, closed world, as you will be using for your project, and show that it is rational (use the complete definition of rationality defined in C2 and the rationality test).

Outline

II. Intelligent agents

III. Search1. Uninformed

2. InformedA. Heuristic

B. Local

C. Online

3. Constraints satisfaction

Search applications

• Obvious:– Finding Olympic Games schedule on the Web.– Finding the cheapest trip between here and Tokyo.– A robot navigating an environment strewn with

obstacles.– A web-crawler indexing web pages

• Less Obvious:– Playing Chess– Job Shop Scheduling– Planning a party

Search ingredients

• nodesnodes : locations

• arcsarcs : connections between nodes– directeddirected : only be traversed in one direction

• netnet or graphgraph : collection of arcs & nodes– treetree : if node has unique parent (w one

exception)– rootroot : exception; has no parents

A Directed Graph (DG)

– In fact a Directed Acyclic Graph (DAG)

L

S

O

PQ

F

M

N

Search

– If we want to search through this graph from S to F this graph can be viewed as a tree.

L

S

O

P Q

F

M

N F

F

F

L

S

O

P

Q

F

M

N

Search algorithms

General search

• Offline, simulated exploration of state-space

• Generating successors of already explored states (expanding)

Example: traveling in Romania

General search example

Arad

General search example

Arad

Zerind Sibiu Timisoara

General search example

Arad

Zerind Sibiu Timisoara

Arad Oradea Fagarash RamnicuValcea

Sibiu Bucharest

Implementation of general search

States vs. nodes

Fagarash

Sibiu Bucharest

Depth=2

parent

children

In:Fagarash

StateState

NodeNode

Strategy characteristics• order node expansion =?

• parameters:– Completeness: solution?

– Optimality: best solution? – Complexity:

• Time: max no. steps to solution

• Space: nodes in memo

• parameters of complexity computation:– bb: max branching factor of search tree

– dd: depth of least-cost solution

– mm: max depth of state space

III.1.Uninformed search algorithms

Breadth-first search

• Expand shallowest node first

• Implementation: FIFO queue

Breadth-first example

Arad

Breadth-first example

Arad

Zerind Sibiu Timisoara

Arad Oradea Arad

Breadth-first example

Arad

Zerind Sibiu Timisoara

Oradea Fagarash RamnicuValcea Arad Lugoj

Arad Oradea Arad

Breadth-first example

Arad

Zerind Sibiu Timisoara

Oradea Fagarash RamnicuValcea

SibiuBucharest

Arad Lugoj

ZerindSibiu

Timisoara

ZerindSibiu

ZerindSibiu

Timisoara

ZerindSibiu

Sibiu

CraiovaPitesti

ZerindSibiu

Timisoara

Timisoara

Mehadia

Proprieties of breadth-first search

• Complete?Complete?

• Time?Time?

• Space?Space?

• Optimal?Optimal?

Proprieties of breadth-first search

• Complete?Complete? Yes (if: b, d finite)

• Time?Time? O(bd+1)

• Space?Space? O(bd+1)

• Optimal?Optimal? Yes (if: b, d finite & cost/step=1)

• Problem: space!!

Depth-first search

• Expand deepest node first

• Implementation: LIFO queue

Breadth-first v’s Depth First

Breadth-first

L

S

O

P Q

F

M

N F

F

F

L

S

O

P Q

F

M

N F

F

F

Depth-first

Depth-first example

Arad

Depth-first example

Arad

Zerind Sibiu Timisoara

Arad Oradea

Depth-first example

Arad

Zerind Sibiu Timisoara

Arad Oradea

Depth-first example

Arad

Zerind Sibiu Timisoara

ZerindSibiu

Timisoara

Iterative deepening search

• Depth first search with growing depth

ll = allowed maximal depth in tree

Iterative deepening search example

Aradl = 0

Iterative deepening search example

Aradl = 1

Iterative deepening search example

l = 1Arad

Zerind Sibiu Timisoara

Iterative deepening search example

Aradl = 2

Iterative deepening search example

l = 2Arad

Zerind Sibiu Timisoara

Iterative deepening search example

l = 2

Arad Oradea

Arad

Zerind Sibiu Timisoara

Iterative deepening search example

l = 2

Arad

Arad

Sibiu Timisoara

Oradea Fagarash RamnicuValcea

Iterative deepening search example

l = 2Arad

Timisoara

Arad Lugoj

Proprieties of iterative deepening search

• Complete?Complete? Yes (b,d finite)

• Time?Time? (d+1) + db + (d-1)b2 + …+ bd = O(bd)

• Space?Space? O(bd)

• Optimal?Optimal? Yes (b,d finite & cost/step=1)

Homework 2 – part II

3. Compute the proprieties of the depth-first search (completeness, time -, space complexity, optimality). Hint: some of the memory can be freed after usage.

Other info

• Check IS course 2II40 homepage for info on:– Evaluation of homeworks– Projects & grouping & deadlines

• http://wwwis.win.tue.nl/~acristea/HTML/IS/