Presentation is loading. Please wait.

Presentation is loading. Please wait.

Reactive Mobile Agent Programming with Jinni Copyright © 1999, BinNet Corp. Paul Tarau University of North Texas & BinNet Corporation.

Similar presentations


Presentation on theme: "Reactive Mobile Agent Programming with Jinni Copyright © 1999, BinNet Corp. Paul Tarau University of North Texas & BinNet Corporation."— Presentation transcript:

1 Reactive Mobile Agent Programming with Jinni Copyright © 1999, BinNet Corp. Paul Tarau University of North Texas & BinNet Corporation

2 What is Jinni? JINNI: Java INference engine and Networked Interactor lightweight, multi-threadedlightweight, multi-threaded Prolog-style agent scripting languageProlog-style agent scripting language knowledge processing componentsknowledge processing components high level, distributed, Java based: alternative to RMI, CORBA, KQMLhigh level, distributed, Java based: alternative to RMI, CORBA, KQML

3 Motivation paradigm shift towards networked, mobile, ubiquitous computingparadigm shift towards networked, mobile, ubiquitous computing increasingly complex patterns of interactionincreasingly complex patterns of interaction reactive and mobile agentsreactive and mobile agents inference capabilities, autonomy and self- reliance.inference capabilities, autonomy and self- reliance.

4 BASIC ONTOLOGY: THE USERS' VIEW Things: represented as Prolog termsThings: represented as Prolog terms Places: server component listening on a port + Linda blackboardPlaces: server component listening on a port + Linda blackboard Agents: collections of mobile threadsAgents: collections of mobile threads running a set of goals at set of Placesrunning a set of goals at set of Places transporting and processing Thingstransporting and processing Things

5 A typical Jinni application a hierarchy of Places and Agentsa hierarchy of Places and Agents Agent threads moving between PlacesAgent threads moving between Places wait for/produce Things satisfying constraintswait for/produce Things satisfying constraints sensing changes of state, produce and react to eventssensing changes of state, produce and react to events

6 THE ARCHITECTURE OF JINNI operatorless syntactic subset of Prologoperatorless syntactic subset of Prolog multiple engines running on separate threads,multiple engines running on separate threads, blackboards to communicate between enginesblackboards to communicate between engines Linda coordination, associative searchLinda coordination, associative search

7 Architecture of Jinni - details - high level networking operations: code and computation mobility, remote executionhigh level networking operations: code and computation mobility, remote execution Jinni-to-Java translatorJinni-to-Java translator ability to load code directly from the Webability to load code directly from the Web hypothetical reasoning, backtrackable assumptions, Assumption Grammarshypothetical reasoning, backtrackable assumptions, Assumption Grammars

8 The Jinni Kernel: Basic Linda + Remote Predicate Calls out(X): puts X on the blackboardout(X): puts X on the blackboard in(X): waits until it can take an object matching X from the blackboardin(X): waits until it can take an object matching X from the blackboard all(X,Xs): reads the list Xs matching X currently on the blackboardall(X,Xs): reads the list Xs matching X currently on the blackboard the(Pattern,Goal,Answer): runs Goal to produce the(Answer) or no => here/there switch =>local/remotethe(Pattern,Goal,Answer): runs Goal to produce the(Answer) or no => here/there switch =>local/remote

9 Assertional Constraints vs. Binding Constrains when nonvar(X)...when nonvar(X)... when proven(X) …when proven(X) … when a_fact(X)… more realisticwhen a_fact(X)… more realistic lower granularitylower granularity arguably: more appropriate for distributed programmingarguably: more appropriate for distributed programming

10 Beyond Linda: Blackboard Constraint Operations wait_for(Pattern,Constraint): waits for a Pattern on the blackboard, such that Constraint holds, and when this happens, it removes the result of the match from the blackboardwait_for(Pattern,Constraint): waits for a Pattern on the blackboard, such that Constraint holds, and when this happens, it removes the result of the match from the blackboard notify_about(Pattern): notifies about this Pattern one of the blocked threads which waits for it with a matching constraintnotify_about(Pattern): notifies about this Pattern one of the blocked threads which waits for it with a matching constraint

11 Coordination with Blackboard Constraints ?- notify_about(stock_offer(aol,89)).?- notify_about(stock_offer(aol,89)). ?-wait_for(stock_offer(aol,Price), less(Price,90)).?-wait_for(stock_offer(aol,Price), less(Price,90)).

12 wait_for(Pattern,Constr) wait_for(P,C):- if(take_pattern(available_for(P),C), if(take_pattern(available_for(P),C), true, true, and(local_out(waiting_for(P,C)), and(local_out(waiting_for(P,C)), local_in(holds_for(P,C)) local_in(holds_for(P,C)) ) ). ) ).

13 notify_about(Pattern,Constr) notify_about(P):- if(take_pattern(waiting_for(P,C),C), if(take_pattern(waiting_for(P,C),C), local_out(holds_for(P,C)), local_out(holds_for(P,C)), local_out(available_for(P)) local_out(available_for(P)) ). ).

14 take_pattern/2 take_pattern(Pattern,Constraint):- local_all(Pattern,Ps), local_all(Pattern,Ps), member(Pattern,Ps), member(Pattern,Ps), Constraint, Constraint, local_cin(Pattern,_). local_cin(Pattern,_).

15 Mobile thread operations run_server/0, here/0, there/0, where/1run_server/0, here/0, there/0, where/1 set_this_host/1, set_this_port/1set_this_host/1, set_this_port/1 set_that_host/1,set_that_port/1set_that_host/1,set_that_port/1 move/0, return/0move/0, return/0 bg/1, bg/2, thread_clone/1bg/1, bg/2, thread_clone/1

16 BUILDING BEHAVIORS: BASIC AGENT PROGRAMMING CONSTRUCTS a reactive channel listenera reactive channel listener ?-listen(fun(_)).?-listen(fun(_)). selective channel publisherselective channel publisher ?-talk(fun(jokes)).?-talk(fun(jokes)). will not match:will not match: ?-talk(stocks(quotes,nasdaq))?-talk(stocks(quotes,nasdaq))

17 Example: a stock market trader agent sell(Who,Stock,AskPrice) :- notify_about(offer(Who,Stock,AskPrice)).sell(Who,Stock,AskPrice) :- notify_about(offer(Who,Stock,AskPrice)). buy(Who,Stock,SellingPrice) :- bg(try_to_buy(Who,Stock,SellingPrice)).buy(Who,Stock,SellingPrice) :- bg(try_to_buy(Who,Stock,SellingPrice)). try_to_buy(Me,Stock,LimitPrice) :- wait_for(offer(You,Stock,YourPrice), ……….try_to_buy(Me,Stock,LimitPrice) :- wait_for(offer(You,Stock,YourPrice), ……….

18 Examples of Mobile Computations Window 1: a mobile threadWindow 1: a mobile thread ?- there, move, println(on_server), member(X,[1,2,3]), return, println(back).?- there, move, println(on_server), member(X,[1,2,3]), return, println(back). Window 2: a serverWindow 2: a server ?- run_server.?- run_server.

19 Mobile code vs. RPCs: move once, compute many times ?-for(I,1,1000), remote_run(println(I)), eq(I,1000).?-for(I,1,1000), remote_run(println(I)), eq(I,1000). ?-there, move, for(I,1,1000), println(I), eq(I,1000).?-there, move, for(I,1,1000), println(I), eq(I,1000).

20 Mobile code: WHY? Large database, small agentLarge database, small agent Speed-up: move to a fast processor and back, transparentlySpeed-up: move to a fast processor and back, transparently here/there switch: same code can be run locally or remotelyhere/there switch: same code can be run locally or remotely fault tolerance - move->run->come backfault tolerance - move->run->come back

21 Emulating multiple answer computations ?- there, move, findall(X,for(I,1,3),Xs), return, member(X,Xs).?- there, move, findall(X,for(I,1,3),Xs), return, member(X,Xs). X=1;X=1; X=2;X=2; X=3X=3

22 Reflective Meta Interpreter solve(G):-once(reduce(G,NewG)),NewG.solve(G):-once(reduce(G,NewG)),NewG. reduce(G,G):-is_builtin(G).reduce(G,G):-is_builtin(G). reduce(','(A,B),','(solve(A),solve(B))).reduce(','(A,B),','(solve(A),solve(B))). reduce(G,','(clause(G,Gs),solve(Gs))).reduce(G,','(clause(G,Gs),solve(Gs))).

23 MUTUAL AGENT/HOST SECURITY: THE BRING YOUR OWN WINE PRINCIPLE reflective meta-interpreter: a few lines of Prolog - can be mobile - bring your own!reflective meta-interpreter: a few lines of Prolog - can be mobile - bring your own! a sandbox can protect the Host against the Agenta sandbox can protect the Host against the Agent undecidability of a Turing equivalent meta-interpreter protects the Agent against the Hostundecidability of a Turing equivalent meta-interpreter protects the Agent against the Host

24 Jinni Agent Classes Java layer:Java layer: –code and type inheritance –reaction to events –libraries: Java3D, XML, special devices etc. Prolog layer Prolog layer –knowledge processing –reaction to blackboard constraints –mobile code

25 Shared Virtual Reality Agents Web based: browser+EAI+Java+JinniWeb based: browser+EAI+Java+Jinni Jinni Server + Thin Jinni Applet ConnectorJinni Server + Thin Jinni Applet Connector NEXT: Java 3D + virtual peer-to-peer Jinni networkNEXT: Java 3D + virtual peer-to-peer Jinni network new transport layers: Corba, RMI, HMLnew transport layers: Corba, RMI, HML

26 Stock Market Agents Day trader:Day trader: reactive agentsreactive agents Internet data mining for quotesInternet data mining for quotes user defined rulesuser defined rules far beyond conventional limit/stop/market transactionsfar beyond conventional limit/stop/market transactions

27 Network monitoring new Internet2 infrastructure at UNT new Internet2 infrastructure at UNT directly running in Java enabled routersdirectly running in Java enabled routers mobile agents for Gigabit network monitoringmobile agents for Gigabit network monitoring QoS negotiationQoS negotiation

28 Visual Jinni open sourceopen source extensibleextensible embedding of fast native Prolog acceleratorembedding of fast native Prolog accelerator upcoming Java2D and Java3d librariesupcoming Java2D and Java3d libraries

29 Agent Programming with Controlled Natural Language extension to distfix grammarsextension to distfix grammars patterns, backrackable assumptionspatterns, backrackable assumptions third party speech I/Othird party speech I/O translation from CNL to Kernel Prologtranslation from CNL to Kernel Prolog

30 Educational agents chat, self organizing groupschat, self organizing groups alerts triggered by blackboard constraintsalerts triggered by blackboard constraints reusable agent hierarchiesreusable agent hierarchies student progress evaluationstudent progress evaluation Wizard of Oz help desk: combined human and programmed agentsWizard of Oz help desk: combined human and programmed agents

31 Conclusion Synergy between Logic Programming and Java based distributed programmingSynergy between Logic Programming and Java based distributed programming Integrated infrastructure for building Internet aware, GUI-enabled, networked Agent componentsIntegrated infrastructure for building Internet aware, GUI-enabled, networked Agent components High level software patterns for productivity, reusability, quick prototypingHigh level software patterns for productivity, reusability, quick prototyping


Download ppt "Reactive Mobile Agent Programming with Jinni Copyright © 1999, BinNet Corp. Paul Tarau University of North Texas & BinNet Corporation."

Similar presentations


Ads by Google