Skip to main content

You are here: Teaching, Distributed Systems, Week 6

This week's topic is Multi-Agent Systems.


Internal Page Navigation Links


Learning Outcomes

Upon completion of this week's class and tasks, you should be able to do the following:

  1. Define agency and describe agents in terms of their characteristics
  2. Describe, distinguish between and select as appropriate behaviours for given
  3. Contrast the agent-oriented approach to communication with the object-oriented approach of invocation
  4. Describe the JADE platform and the core agents

Return to the internal page navigation links


Notes and Handouts

Return to the internal page navigation links


Tasks

Task NumberDetails
1

Download the Java Agent Development Environment. After registration select jadeBin.zip, and extract the contents to the root of your c: drive.

2

Since JADE is a Java environment comprised of many classes, you will need to add all the appropriate classes to your CLASSPATH - this must be done to allow your JRE locate the files. Create a file named set_cp.bat, and put the following lines of text into it:

set JADE_LIB=c:\jade\lib
set CLASSPATH=.;%JADE_LIB%\http.jar;%JADE_LIB%\iiop.jar;%JADE_LIB%\jade.jar;%JADE_LIB%\jadeTools.jar;%CLASSPATH%
						

If you cannot read all the above, copy the contents of this linked file.

Save set_cp.bat into the folder where you will be storing your Java classes - i.e. your local directory.

3

Download ClassmateAgent.java and store it in your local directory.

4

Compile ClassmateAgent.java as follows:

set_cp

javac ClassMateAgent.java
						
5

Start your JADE environment as follows:

java jade.Boot -gui -container-name ciaran_container_1
						

You can give your container any name you want. Since you're going to create more than one, you should probably order them by appending a number to the name.

6

Load your agent into the container by selecting your container and clicking Start New Agent (the left-most button).

Give your agent your own name. The class name is the name of the Java program you downloaded i.e. ClassmateAgent.

If you now return to your command prompt, you should see that your agent is intermittently printing out details of its location.

You can suspend and resume it by clicking on the controller buttons.

7

Open another command prompt and start a second container, with a different name.

Since you want this container to join in the session already started, you need to provide an additional argument.

java jade.Boot -container -container-name ciaran_container_2
						

The -container switch indicates that this will not be a new platform, but simply a new container joining the existing platform.

If you return to your manager, you should see the second container.

You can get your agent to migrate to the new container, but selecting the agent and clicking on the Migrate Agent button - the sixth from the left.

Enter ciaran_container_2 as the new container name.

Observe now that our agent prints out a message in the environment it is leaving, and prompts the user for their name in the new environment.

8

If you want, you can connect containers from different hosts, by including the IP address of the main container.

java jade.Boot -container -host IPADDRESS -container-name friend_container_1
						
9

Download and compile each of the following files:

10

Start a container and put a BookSellerAgent into it. You will be prompted to enter a book title and price. The seller will then wait for messages from buyers who are looking for books.

Start a buyer - it periodically looks up all the sellers and asks them if they are selling the book that they are looking for. It will buy the book from the seller with the lowest price, and then exit.

Use the following command to launch a buyer agent:

java jade.Boot -container -container-name ciaran_container_2 buyer:BookBuyerAgent(DaVinci-Code)
						

Note: Use dashes instead of spaces in the book names.

Return to the internal page navigation links


Further Reading

Return to the internal page navigation links