Agent Name Server
User Guide


Index | Overview | Requirements | Querying an ANS
Starting an ANS | ANS for Windows | Javadocs | Bug Report


Querying Your ANS (Option 1)

An Agent Name Server can be queried on your machine manually at the Unix command prompt or via the ANS Graphical User Interface (TestANSGUI). Two complete sets of instruction are available, one set for each querying method. Each set is independent of the other, so feel free to jump directly to the test method you prefer. The manual method is below, the TestANSGUI method is on the next page.

Please keep in mind, however, that we virtually never register agents manually. This user guide is meant to demonstrate what typically occurs automatically through the Communicator Package.

Querying ANS at the command prompt | Querying ANS with the GUI


Querying ANS at the Command Prompt

  1. Verify that an Agent Name Server (ANS) is running on one of your machines. To locate an ANS, you have two options:

    1. Option 1: Run testANS on the machine where you think an ANS is running. You can do this from any machine.

      The basic command for running the testANS program is:

      java EDU.cmu.softagents.misc.ANS.testANS <host name> <port>

      Note that host name and port are only required if you are testing an ANS that is running on another machine.

      Running testANS Example
      java EDU.cmu.softagents.misc.ANS.testANS sophocles 6677 <CR>
      Connected to sophocles/128.2.213.48;6677
      ANS>

      In this example, the ANS on host "sophocles" is tested from host machine "midea." At the time of testing, no agent names were registered with "ANSsophocles."

    2. Option 2: Look for an "ANSlistFile" in one of the sub-directories of "pleiades_classes." While each "ANSlistFile" may contain a different set of Agent Name Servers, chances are that you will be able to get a partial ANS list by opening an "ANSlistFile." The "pleiades_classes" directory is located in:

      /afs/cs.cmu.edu/project/pleiades/java/pleiades_classes/java

      To retrieve an "ANSlistFile," try the "infoagents" sub-directory:

      Looking for an "ANSlistFile" Example
      cd /afs/cs.cmu.edu/project/pleiades/java/pleiades_classes/java/
      EDU/cmu/softagents/infoagents/InfoAgent <CR>

      Choose one ANS from the "ANSlistFile" and run testANS on it by following Option 1 above. When you see "ANS" followed by a command prompt, the testANS program is ready to receive commands.


  2. Issue commands to the testANS program. Possible testANS commands include:

    list all Lists all agents registered with your ANS. If you have just started your ANS, output is "null" list all
    register Registers an agent name with the ANS register <agent name> <protocol>://<agent host>:<agent port>
    lookup Returns the IP address and port of registered <agent name> lookup <agent name>
    unregister Unregisters an agent name from the ANS unregister <agent name>
    bye Disconnects from the ANS and quite testANS bye

    The following is a sample testANS session using the ANS called "ANSmidea" (for information on starting a new ANS, see Starting an ANS):

    Sample testANS Session
    ANS>
    list all
    null
    ANS>
    register midea_agent tcp://midea.cimds.ri.cmu.edu:6567
    success
    ANS>
    list all
    midea_agent
    ANS>
    lookup midea_agent
    tcp://midea.cimds.ri.cmu.edu:6567
    ANS>
    unregister midea_agent
    success
    ANS>
    list all
    null
    ANS>
    bye
    null
    Connection closed by server

    Note that your ANS will still be running after you quit testANS.

To initiate communication among agents, you will need to run the KQMLMessageSenderGUI, which provides an interface for testing KQML message formats. (See the KQMLMessageSenderGUI User Guide for more information.)

Next Page: Querying ANS with the GUI
Previous Page: System and Other Requirements
Or jump to: Javadocs


Copyright 1999 © Software Agents Group
Send questions and comments to:
Pleiades
<pleiades@cs.cmu.edu>
Software Agents Group
Internal Site
Robotics Institute