SDSU CS 696 Emerging Technologies: Java Distributed Computing
Spring Semester, 1999
Agent Communication
Previous    Lecture Notes Index        
© 1999, All Rights Reserved, SDSU & Roger Whitney
San Diego State University -- This page last updated 11-May-99

Contents of Doc 35, Agent Communication


References


An Overview of KQML, Yi Luo http://www.seas.upenn.edu/~yiluo/kqml.html

Voyager Documentation

Doc 35, Agent Communication Slide # 2

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

This will produce the most efficient run time results of the three options

2 Configure the orbs to dynamically download classes.

On the orb that an agent is to visit one can use the command line:

voyager port -c URL_For_Classes

So the following run on rohan will start a voyager orb on rohan running on port 8000, that dynamically downloads classes from eli.sdsu.edu port 8888
voyager //rohan.sdsu.edu:8000 –c http://eli.sdsu.edu:8888

3 Configure the agents to "carry" its class files around


Doc 35, Agent Communication Slide # 3
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
loads resources from a specific URL.
ArchiveResourceLoader
Loads resources from a jar file over the network


Doc 35, Agent Communication Slide # 4
Remaining Agent Issues To Cover

Where is the Party?
That is how does an agent know were to go and how to find other agents and code to interact with

What does an agent say at the party?
How does an agent interact with other agents? In particular how does an agent interact with agents written by other people?

Agent Communication Languages (ACL)


KQML (Knowledge Query & Manipulation Language)

FIPA ACL (Foundation for Intelligent Physical Agents ACL)

Doc 35, Agent Communication Slide # 5

KQML

The information about KQML is taken from An Overview of KQML, Yi Luo

Basic syntax
( <performative> { :< keyword> <parameter> } )

Example

( ask-one
:sender joe 
:content (PRICE IBM ?price) 
:receiver stock-server 
:reply-with ibm-stock 
:language LPROLOG 
:ontoloty NYSE-TICKS )

Layers of message

Content: Information Format
Communicates "content" expressed in a certain "language" and "ontology
Message: Communication Scene
Message Layer tells the receiver what actions should be executed.
Transport: Data Availability
Contains information about the transport of data. Contains " sender" and " receiver" of a message and the message ID (" reply-with" and " in-reply-to").


Doc 35, Agent Communication Slide # 6

Performatives


The performatives are categorized into the follow types in the first specification draft:



Basic informative performatives

tell: indicates that the :content sentence is in the :sender's virtual knowledge base.

deny: it has a performative in its content and indicates that the meaning of the embedded <performative> is not true of the sender. A deny of a deny cancels out.

Untell: equivalent to a deny of a tell.


Doc 35, Agent Communication Slide # 7
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.

Doc 35, Agent Communication Slide # 8
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.

.

Doc 35, Agent Communication Slide # 9
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.

Doc 35, Agent Communication Slide # 10

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