CS 696 Emerging Technologies: Java Distributed Computing Spring Semester, 1999 Agent Communication |
||
---|---|---|
© 1999, All Rights Reserved, SDSU & Roger Whitney San Diego State University -- This page last updated 11-May-99 |
Agents and Their Executables
One issue with agents is how to insure that the code needed to execute them exists on the sites they visit. Interpreted languages make it easier to allow agents to execute on different hardware platforms. As we have seen, in Java the class files need to be made available on each site an agent visits. In Voyager there are three options for doing this.
1 Install the class files on all machines the agent might visit
Configuring an Agent’s Codebase
public static void main( String[] arguments) { try { Voyager.startup( "8000" ); String serverClass = "whitney.voyager.examples.agent.HelloAgent"; HelloAgent bond = new HelloAgent(); System.out.println( bond.sayHello()); IAgent agentProxy = Agent.of( bond ); agentProxy.setResourceLoader( new URLResourceLoader( new URL("http://eli.sdsu.edu:8000"))); bond.move( "tcp://fargo.sdsu.edu:8000" ); } catch (Exception e) { System.out.println("HelloServer err: "); e.printStackTrace(); } } }
Voyager supports two types of resource loaders for agents:
URLResourceLoader
Remaining Agent Issues To Cover
Where is the Party?
KQML
The information about KQML is taken from An Overview of KQML, Yi Luo
Basic syntax
( ask-one :sender joe :content (PRICE IBM ?price) :receiver stock-server :reply-with ibm-stock :language LPROLOG :ontoloty NYSE-TICKS )
Performatives
The performatives are categorized into the follow types in the first specification draft:
Database performatives
insert: requests the receiver to add a sentence to its VKB (Virtual knowledge base)
delete: requests the receiver to delete a sentence from its VKB.
delete-one: requests the receiver to delete one sentence from its VKB, which matches :content and return with the deleted sentence.
delete-all: requests the receiver to delete all sentences matching the :content, and return the set of deleted sentences.
Basic query performatives
evaluate: requests the recipient to simplify the expression in the :content parameter, and reply with the result.
reply: indicates that the sender believes that :content is an appropriate reply to the query in the :in-reply-to message.
ask-if: same as evaluate, except that the :content must be a sentence schema in the :language. In other words, the sender wishes to know if the :content matches any sentence in the recipient's VKB.
ask-about: is like ask-if, except that the reply should be the collection of all sentences in the recipient's VKB that contain a sentence or term that matches the sentence or term schema in the :content.
ask-one: is like an ask-if, except that the :aspect parameter describes the form of the desired reply; for some match of the :content in the recipient's VKB, the reply will be the :aspect with all of its schema variables replaced by the values bound to the corresponding schema variables in :content.
ask-all: is like ask-one, except that the reply should be a collection of instantiated aspects corresponding to all matches of the :content sentences on the recipient's VKB.
.
Networking performatives
register: indicates that the sender can deliver performatives to the agent named by the :name parameter (this subsumes the case when the sender calls itself by this name).
rnregister: same as a deny of a register.
forward: indicates that the sender wants the :to agent to process the performative in the :content parameter as if it came from the :from agent directly.
broadcast: indicates that the sender would like the recipient to route the broadcast performative to each of its outgoing connections, unless the recipient has already received a broadcast performative with this :reply-with (for cycle detection).
pipe: indicates that future traffic on this channel should be routed to the :to agent, as if :to and :from were directly connected.
break: breaks a pipe.
transport-address: defines an association between a symbolic name for a KQML agent and a transport address.
Sample Communications between Agents
A to B: (perform (print "Hello, the world!" t)) B to A: (reply done) A to B: (ask-if ( > (size chip1) (size chip2))) B to A: (reply true) A to B: (subscribe (position ?x ?r ?c)) B to A: (tell (position chip1 8 10)) B to A: (tell (position chip2 8 46)) B to A: (tell (position chip3 8 64)) A to B: (unsubscribe (position ?x ?r ?c))
Copyright ©, All rights reserved.
1999 SDSU & Roger Whitney, 5500 Campanile Drive, San Diego, CA 92182-7700 USA.
OpenContent license defines the copyright on this document.
Previous    visitors since 11-May-99