Presentation is loading. Please wait.

Presentation is loading. Please wait.

The Semantic Web Week 20: Agents that can plan and learn.. Module Website: Practical this week:

Similar presentations


Presentation on theme: "The Semantic Web Week 20: Agents that can plan and learn.. Module Website: Practical this week:"— Presentation transcript:

1 The Semantic Web Week 20: Agents that can plan and learn.. Module Website: http://scom.hud.ac.uk/scomtlm/chs2533 Practical this week:

2 Today 1. Relationship between Generative Planning and OWL-S 2. More on reasoning with actions Rest of Course: Weeks 21 - 23 SW Applications and current activity: European Projects + Information Management

3 Recall OWL-S – upper level ontology ServiceProfile ServiceModel ServiceGrounding Service presents describedby supports OWL-S is a language for describing web services. It is built from DAML-S and is written in OWL. There are 3 parts to a web service specification:

4 OWL-S n The Service Model contains a model of the PROCESS of the Service – and a concrete definition of Inputs, Outputs, Preconditions, Effects op( getMoney(Bank,20), [ ], [ssc(Bank, [ have_password(Bank,P), balance(Bank,A), ge(A,20), is(AZ,A-20) ], [have_password(Bank,P), balance(Bank,AZ) ] ), ssc(M, [haveresource(M,Y), is(YZ,Y+20) ],[haveresource(M,YZ)] ) ], [ ]). Input Bank = ebank Preconditions = have_password(ebank,P), balance(ebank,A), haveresource(M,Y), ge(A,20), is(AZ,A-20) is(YZ,Y+20) Effects/Outputs = have_password(Bank,P), balance(Bank,AZ), haveresource(M,YZ) ¬ balance(ebank,A), ¬haveresource(M,Y),

5 Planning program example task2 :- startOCL([ se(ticket,[have_ticket(ticket,apollo,cats)]), se(dvd2, [have_dvd(dvd2,amazon,terminator)]), se(dvd1, [have_dvd(dvd1,amazon,star_wars)]) ], [ ss(ebank, [have_password(ebank,abcd),balance(ebank,100)]), ss(money, [haveresource(money,10)]), ss(service,[logged_off]), ss(apollo, [service(apollo),freeseat(apollo,cats),seat_price(apollo,25)]), ss(amazon, [ service(amazon), dvd_price(amazon,terminator,10), instock(amazon, terminator), instock(amazon, star_wars), dvd_price(amazon,star_wars,15)]), ss(dvd1, [have_no_dvd(amazon,star_wars)] ), ss(dvd2, [have_no_dvd(amazon,terminator)] ), ss(ticket, [have_no_ticket(apollo,cats)]) ] ). GOALS “STATIC” KNOWLEDGE

6 Operator Schema op( buy_dvd(DVD,Seller,Prod,Price), [se(Seller, [instock(Seller,Prod),dvd_price(Seller,Prod,Price)]), se(S,[logged_on(S,Seller)] ], [ssc(M, [haveresource(M,Y), ge(Y, Price), is(YX,Y-Price)],[haveresource(M,YX)]), ssc(DVD, [have_no_dvd(Seller,Prod)],[have_dvd(DVD,Seller,Prod)]) ], [ ]). op( book_theatre_seat(Ticket,Seller,Prod), [se(Seller,[freeseat(Seller,Prod),seat_price(Seller,X)]), se(S,[logged_on(S,Seller)]) ], [ssc(Money, [haveresource(Money,Y), ge(Y, X), is(YX,Y-X)],[haveresource(Money,YX)]), ssc(Ticket, [have_no_ticket(Seller,Prod)],[have_ticket(Ticket,Seller,Prod)]) ], [ ]). op( getMoney(Bank,20), [ ], [ssc(Bank, [ have_password(Bank,P), balance(Bank,A), ge(A,20), is(AZ,A-20) ], [have_password(Bank,P), balance(Bank,AZ) ] ), ssc(M, [haveresource(M,Y), is(YZ,Y+20) ],[haveresource(M,YZ)] ) ], [ ]). op( logon(Seller), [se(money,[haveresource(money,R),gt(R,0)]), se(Seller,[service(Seller)]) ], [ssc(service, [logged_off],[logged_on(service,Seller)]) ], [ ]). op(logoff(Seller), [ ], [ssc(service, [logged_on(service,Seller)],[ logged_off ]) ], [ ]). Dynamic Knowledge

7 Execution Example | ?- task2................... goal [se(ticket,[have_ticket(ticket,apollo,cats)]), se(dvd2,[have_dvd(dvd2,amazon,terminator)]), se(dvd1,[have_dvd(dvd1,amazon,star_wars)])] achieved by sequence [getMoney(ebank,20),getMoney(ebank,20), logon(apollo),book_theatre_seat(ticket,apollo,cats),logoff(apollo), logon(amazon),buy_dvd(dvd2,amazon,terminator,10),buy_dvd(dvd1,amazon,star_wars,15)] 699 nodes generated 4.51 seconds of cpu 154.9889135254989 nodes search per second new state is [ss(dvd1,[have_dvd(dvd1,amazon,star_wars)]),ss(money,[haveresource(money,0)]),ss(dvd2,[ have_dvd(dvd2,amazon,terminator)]),ss(service,[logged_on(service,amazon)]),ss(ticket,[have_ticket(ticket,apollo,cats)]),ss(ebank,[have_password(ebank,abcd),balance(eban k,60)]),ss(apollo,[service(apollo),freeseat(apollo,cats),seat_price(apollo,25)]),ss(amazo n,[service(amazon),dvd_price(amazon,terminator,10),instock(amazon,terminator),instoc k(amazon,star_wars),dvd_price(amazon,star_wars,15)])]

8 Planning Algorithm Nodes = (State, Sequence of actions that got to State) 1. Store the first node (initial state + empty solution) Repeat 2. pick a node (State, Sequence) 3. pick an action and parameter grounding - ‘A' - that can be applied to State 4. apply A to State to get State' 5. store new node (State', Sequence + A) 6. if possible, backtrack to 3. and make a different choice. Until a node (State, Sequence) has been asserted such that State contains the goal literals

9 Applying Planning Actions.. 4. apply A to State to get State‘ …. A = getMoney(ebank,20) op( getMoney(Bank,20), [ ], [ssc(Bank, [ have_password(Bank,P), balance(Bank,A), ge(A,20), is(AZ,A-20) ], [have_password(Bank,P), balance(Bank,AZ) ] ), ssc(M, [haveresource(M,Y), is(YZ,Y+20) ],[haveresource(M,YZ)] ) ], [ ]). Parameter “Bank” => constant “ebank” getMoney(ebank,20) = Precondition = have_password(ebank,P), balance(ebank,A), ge(A,20), is(AZ,A-20), haveresource(M,Y), is(YZ,Y+20) Post condition = have_password(ebank,P), balance(ebank,AZ), haveresource(M,YZ)

10 Planning Algorithm: applying actions 4. apply A to State to get State‘ …. EXAMPLE State = [ ss(ebank, [have_password(ebank,abcd), balance(ebank,100)]), ss(money, [haveresource(money,10)]), ss(service,[logged_off]), …. ETC] ). getMoney(ebank,20) = Precondition = have_password(ebank,P), balance(ebank,A), ge(A,20), is(AZ,A-20), haveresource(M,Y), is(YZ,Y+20) Post condition = have_password(ebank,P), balance(ebank,AZ), haveresource(M,YZ) Apply A: 1. Are the precondition’s achieved? Yes, with P =“abcd”, A=100, AZ = 80, M = money, Y = 10, YZ = 30 2. Apply Post Conditions State’ = [ ss(ebank, [have_password(ebank,abcd), balance(ebank,80)]), ss(money, [haveresource(money,30)]), ss(service,[logged_off]), …. ETC] ).

11 Example Agent Architecture Agent Generative PLANNER USER Static Knowledge Base Dynamic Knowledge Base Plan Execution Learning Component Feedback Failure WEB ENVIRONMENT High Level Requests Response

12 Summary n Agents have to have a degree of autonomy to make them useful. They need to be able to reason with actions, time, events, resources. n Web Agents will be able to effect things by using Web Services (collect information, supply information, buy goods, organise transactions..) n Planning algorithms are useful to allow agents to make plans that achieve goals


Download ppt "The Semantic Web Week 20: Agents that can plan and learn.. Module Website: Practical this week:"

Similar presentations


Ads by Google