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.
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.
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."
/afs/cs.cmu.edu/project/pleiades/java/pleiades_classes/java
To retrieve an "ANSlistFile," try the "infoagents" sub-directory:
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.
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):
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
|