# آموزش هوش مصنوعی - بخش سوم

• View
50

0

Embed Size (px)

### Text of آموزش هوش مصنوعی - بخش سوم

:

:

1

2

3

:

goal)1. formulation):

problem)2. formulation):

.)(:(search)3.

.:(execute)4.

4

:

5

6

function SIMPLE-PROBLEM-SOLVING-AGENT(percept) return an action

static: seq , an action sequence

state, some description of the current world state

goal, a goal

problem, a problem formulation

state UPDATE-STATE(state, percept)if seq is empty then

goal FORMULATE-GOAL(state)

problem FORMULATE-PROBLEM(state , goal)

seq SEARCH(problem)

action FIRST(seq)

seq REST(seq)return action

7

1)2)3)4)5)

8

9

10

Single): State)(Sensorless/Conformant):(Contingency):(Exploration/Online):

11

5:][

12

{8....21}:][:

13

14

15

{31}:

()

:

16

17

18

(implicit)path) cost):C(x, a, y)..:(solution)optimal) solution):.

19

: 8::{}:{87}::

20

: ::{}:::

21

8: 1):::8:-:

22

8: 1))):::8:-:100.

23

8: 2):8:::-:

24

: :::::

25

26

27

=..

()

28

function SIMPLE-PROBLEM-SOLVING-AGENT(percept) return an action

static: seq , an action sequence

state, some description of the current world state

goal, a goal

problem, a problem formulation

state UPDATE-STATE(state, percept)if seq is empty then

goal FORMULATE-GOAL(state)

problem FORMULATE-PROBLEM(state , goal)

seq SEARCH(problem)

action FIRST(seq)

seq REST(seq)return action

29

function SIMPLE-PROBLEM-SOLVING-AGENT(percept) return an action

static: seq , an action sequence

state, some description of the current world state

goal, a goal

problem, a problem formulation

state UPDATE-STATE(state, percept)if seq is empty then

goal FORMULATE-GOAL(state)

problem FORMULATE-PROBLEM(state , goal)

seq SEARCH(problem)

action FIRST(seq)

seq REST(seq)return action

30

function TREE-SEARCH(problem, strategy) return a solution or failureInitialize search tree to the initial state of the problemdo

if no candidates for expansion then return failureelse choose leaf node for expansion according to strategyif node contains goal state then return solutionelse expand the node and add resulting nodes to the search tree

end do

31

:

32

function TREE-SEARCH(problem, strategy) return a solution or failureInitialize search tree to the initial state of the problemdo

if no candidates for expansion then return failureelse choose leaf node for expansion according to strategyif node contains goal state then return solutionelse expand the node and add resulting nodes to the search tree

end do

33

34

function TREE-SEARCH(problem, strategy) return a solution or failure

Initialize search tree to the initial state of the problem

do

if no candidates for expansion then return failure

else choose leaf node for expansion according to strategy

if node contains goal state then return solution

else expand the node and add resulting nodes to the search tree

enddo

.

35

function TREE-SEARCH(problem, strategy) return a solution or failure

Initialize search tree to the initial state of the problem

do

if no candidates for expansion then return failure

else choose leaf node for expansion according to strategy

if node contains goal state then return solution

else expand the node and add resulting nodes to the search tree

enddo

function SIMPLE-PROBLEM-SOLVING-AGENT(percept) return an action

static: seq , an action sequence

state, some description of the current world state

goal, a goal

problem, a problem formulation

state UPDATE-STATE(state, percept)if seq is empty then

goal FORMULATE-GOAL(state)

problem FORMULATE-PROBLEM(state , goal)

seq SEARCH(problem)

action FIRST( seq )

seq REST(seq)return action

36

(2)

37

function TREE-SEARCH(problem, fringe) return a solution or failure

fringe INSERT(MAKE-NODE(INITIAL-STATE[problem]), fringe)

loop do

if EMPTY?(fringe) then return failure

node REMOVE-FIRST(fringe)

if GOAL-TEST[node] then

return SOLUTION(node)

else

fringe INSERT-ALL(EXPAND(node, problem), fringe)

Insert_All(Expand( Goal Test( Remove-First(

38

function TREE-SEARCH(problem, strategy) return a solution or failure

Initialize search tree to the initial state of the problem

do

if no candidates for expansion then return failure

else choose leaf node for expansion according to strategy

if node contains goal state then return solution

else expand the node and add resulting nodes to the search tree

enddo

...S:Suck:S:

39

(state)

.

.(node).

(FRINGE)().

40

41

function EXPAND(node,problem) return a set of nodes

successors the empty set

for each in SUCCESSOR-FN[problem](STATE[node]) do

s a new NODE

STATE[s] result

PARENT-NODE[s] node

ACTION[s] action

PATH-COST[s] PATH-COST[node] + STEP-COST(node, action,s)

DEPTH[s] DEPTH[node]+1

return successors

..()

:1):2)

/:3):4)

42

:(b):(d):(m):))

43

.()

.()

44

Breadth-first)1. search)Uniform-cost)2. search)Depth-first)3. search)Depth-limited)4. search)Iterative)5. deepening search)Bidirectional)6. search)

45

( 1FIFO(

Documents
Engineering
Engineering
Documents
Documents
Documents
Documents
Documents
Science
Documents
Documents
Documents
Documents
Documents
Documents
Documents
Documents
Documents
Engineering
Documents
Documents
Documents
Documents
Documents
Documents
Documents
Documents
Documents
Documents