g eneral p roblem s olver

36
GeneralProblemSolv er Monkey and Banana 2013 Artificial Intelligence Lecture no. 14

Upload: zoltin

Post on 23-Jan-2016

49 views

Category:

Documents


0 download

DESCRIPTION

G eneral P roblem S olver. Monkey and Banana. 2013 Artificial Intelligence Lecture no. 14. G eneral P roblem S olver. 人間の問題解決過程のモデル. 与えられた 知識 → 問題 を解決. 初期 状態 (Initial State) 目的 状態 (target State) オペレータ (operator) 状態 表現 (state representation). 与えられ た 知識 Given Knowledge. など. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: G eneral P roblem S olver

GeneralProblemSolver

Monkey and Banana

2013 Artificial Intelligence

Lecture no. 14

Page 2: G eneral P roblem S olver

GeneralProblemSolver

人間の問題解決過程のモデル与えられた知識 → 問題を解決

• 初期状態 (Initial State)

• 目的状態 (target State)

• オペレータ(operator)

• 状態表現 (state representation)

与えられた知識Given Knowledge

など

Page 3: G eneral P roblem S olver

Monkey and Banana

How the monkey gets banana ?Needs to climb up on the box

Page 4: G eneral P roblem S olver

状態表現 (State Representaiton)

AT(A, X) A is at XON(A, X) A is on XEMPTY Monkey’s HAND is EMPTYHOLD Monkey HOLDS banana

Page 5: G eneral P roblem S olver

初期状態 (initial state), 目的状態 (target state)

AT(monkey, a)

AT(box, b)

EMPTY

Initial State

HOLD

Target State

(monkey holds banana)

Page 6: G eneral P roblem S olver

Operators

GOTO(a) Monkey goes to “a” CLIMB Monkey climbs up on the Box

PC 前提条件 (none) PC 前提条件 AT(monkey, y),AT(box, y)

D 削除リスト

AT(monkey, x) D 削除リスト AT(monkey, y)

A 追加リスト

AT(monkey, a) A 追加リスト ON(monkey, box)

MOVEBOX(a)

Monkey moves the box to “a”

GRASP バナナを掴む

PC 前提条件 AT(monkey, y) ,AT(box, y)

PC 前提条件 AT(box, c), ON(monkey,box)

D 削除リスト

AT(monkey, y) , AT(box, y)

D 削除リスト EMPTY

A 追加リスト

AT(monkey, a) AT(box, a)

A 追加リスト HOLD

Page 7: G eneral P roblem S olver

問題解決 How to solve the problem ?

現在の状態 (S) と目的状態 (G) を近づける

             S  →  G

S=G : 同じ状態

difference   =   G - S

Reduce

Page 8: G eneral P roblem S olver

Importance of Differences

D3 = distance between monkey and banana

D2= distance between the box and banana

D1 = distance between monkey and banana

Most important

Necessary to solve D3

Necessary to solve D2

importance D3 > D2 > D1

Page 9: G eneral P roblem S olver

Operators to reduce distances

GOTOMOVEBO

XCLIMB GRASP

D1(monkey) ○ ○ ○

D2(box) ○

D3(monkey’s hand) ○

operatorsdistance

s

Page 10: G eneral P roblem S olver

GPS algorithm1.LOOP1: if S satisfy then exit(S)2.find D=most important difference between G

& S3.put all the operators to reduce D into

oplist4.LOOP2: if empty(oplist) then

return(null)5. operator:=first(oplist), remove(operator, oplist), pc := operator の前提条件 , if not effective(operator) then goto LOOP2 : give up, if operator fails to reduce d 6. if (pc = null) then goto APPLY 7. S1 = GPS(S, pc)8. If S1=fail then goto LOOP29. APPLY : S := operator (S1)10.goto LOOP1

Page 11: G eneral P roblem S olver

GPS algorithm solves“Monkey and Banana”

Page 12: G eneral P roblem S olver

Introduction

AT(monkey, a)AT(box, b)EMPTYInitial state S0

HOLD

Final state G0

Monkey gets banana

GPS(S0 , G0)

Page 13: G eneral P roblem S olver

GPS(S0, G0)Step 1: Continue GPS unless S0=G0

Step 2: Find differences between S0 and G0

D3 = |monkey – banana| D2 = |box – banana| D1 = |box – monkey|

D3 is most important!

Page 14: G eneral P roblem S olver

GPS(S0, G0)

Step 3Operator to reduce D3 is GRASP→GRASP is put into oplist

Step 4 oplist is not empty

Continue GPS

Page 15: G eneral P roblem S olver

GPS(S0, G0)

Step 5

operator = first(oplist), first(oplist) is removed from oplist,pc

GRASP solves D !

Page 16: G eneral P roblem S olver

GPS(S0, G0)

Step 6Continue to Step 7 if pc exists (if not, jump to Step 9)

Step 7GPS(S0, pc)

Page 17: G eneral P roblem S olver

GPS(S0, G1)Step 1

Continue GPS, unless S0=G1

Step 2Distances between S0& G1

D2 =|box - banana|   D1 = |monkey – box|

D2 is most important

Page 18: G eneral P roblem S olver

GPS(S0, G1)Step 3

D is solved by MOVEBOX,Put MOVEBOX into oplist

Step 4Continue GPS unless oplist is empty

Page 19: G eneral P roblem S olver

GPS(S0, G1)Step 5

Substitute prerequisit conditions into pc

AT(box, y), AT(monkey, y)}where y=b is necessary to solve D2

pc = {AT(box, b), AT(monkey, b)}

Continue, since MOVEBOX reduces D2

Page 20: G eneral P roblem S olver

GPS(S0, G1)Step 6

Continue to Step 7 since pc is not empty(if not, jump to Step9)

Step 7Run GPS(S0, pc)

Page 21: G eneral P roblem S olver

GPS(S0, G2)Step 1

Continue GPS unless S0=G2

Step 2Distance between S0 and G2

D1 =|monkey - box|

D1 is most important

Page 22: G eneral P roblem S olver

GPS(S0, G2)

Step 3Find operators to reduce D1 す and put them into oplist GOTO and CLIMB are put into oplist

Step 4Continue GPS unless oplist is empty

Page 23: G eneral P roblem S olver

GPS(S0, G2)

Step 5oplist = {CLIMB} , operator = GOTO

Prerequisit conditions of the operator are substituted to pc

pc = (none)

GOTO reduces D1

Step 6No more pc existJump to Step 9

Page 24: G eneral P roblem S olver

GPS(S0, G2) → GPS(S1, G2)Step 9

Apply operator on S0

operator = GOTO(b)

New state S1

Page 25: G eneral P roblem S olver

GPS(S1, G2) → GPS(S1, G1) Step 10

Go to Step 1

Step 1S0=G1

End GPS(S1, G2)

Go back to GPS(S1, G1)

Page 26: G eneral P roblem S olver

GPS(S1, G1) → GPS(S2, G1) Step 8

Continue if S1 is not fail

Step 9Apply operator on S1

operator = MOVEBOX(c)

New state S2

Page 27: G eneral P roblem S olver

GPS(S2, G1)Step10

Go to Step1

Step 1Continue GPS unless S0=G1

Step 2Difference between S2and G1

D1 =|monkey – box|

D1 is most important

Page 28: G eneral P roblem S olver

GPS(S2, G1)Step3

Operators to solve D1 are GOTO and CLIMBAdd GOTO and CLIMB to oplist

Step 4Continue GPS unless oplist is empty

Page 29: G eneral P roblem S olver

GPS(S2, G1)Step5

oplist = {CLIMB} , operator = GOTO

Substitute prerequisite conditions to pc

pc = (none)

Go to Step 4, sinceNo operator can reduce D1

Page 30: G eneral P roblem S olver

GPS(S2, G1)Step 5

oplist = {} , operator = CLIMB

Substitute prerequisite conditions of operators into pc

AT(box, y), AT(monkey, y)}

where y=c reduces D1 pc= {AT(box, c), AT(monkey, c)}

Continue sinceCLIMB reduces D1

Page 31: G eneral P roblem S olver

GPS(S2, G1)Step 6

Continue since pc exists

Step 7Run GPS(S2, pc)

Page 32: G eneral P roblem S olver

GPS(S2, G3) → GPS(S2, G1) Step1

S2=G3

GPS ends.

Go upwards

Page 33: G eneral P roblem S olver

GPS(S2, G1) → GPS(S3, G1) Step 8

Continue since S2 is not fail

Step 9Apply operator on S1

operator = CLIMB

New state S3

Page 34: G eneral P roblem S olver

GPS(S3, G1) → GPS(S3, G0) Step 10

Go to Step 1

Step 1S3=G1

Finish GPS

Go upwards.

Page 35: G eneral P roblem S olver

GPS(S3, G0) → GPS(S4, G0) Step8

Continue since S2 is not fail

Step 9Apply operator on S1

operator = DRASP

New state S4

Page 36: G eneral P roblem S olver

GPS(S4, G0)Step10

Go to Step 1

Step 1S4=G0

Finish GPS

End