|
CSE4MAS Labs and Assignment help |
|
|
Lab # |
Java examples (normally accessable 2 weeks after the labs) |
01 |
|
02 |
- Each agent application should be stored in a different directory.
|
03 |
|
04 |
|
05 |
|
06 |
- This is an example of two-agent communication. There are two agents in this example named "Alice" and "Bob". Alice and Bob have their own networks called AliceNetwork and BobNetwork. While BobNetwork is waiting for connections, Alice initiates the conncection to Bob network and sends Bob a greeting message. When receiving the message from Alice, Bob sends his greeting message back to Alice. [TwoAgentCommunication.zip]
|
07 |
- Communication of three agents [ThreeAgentCommunication.zip]. There are threes agents named Bob, Alice, and John. Firstly, Bob and Alice agents are created and wait for connection. Secondly, John agent is created and connects to Bob. John asks Bob about Alice's connection address. Finally, John connects to Alice and to say "Hello" to her.
|
08 |
- Agents with graphical user interfaces (GUIs) [AgentsWithGUI.zip]. We are designing an application for communication between two agents namely Bob Agent and Alice Agent. Each agent is actually a process by itself and has its own GUI as one of its property (implemented in AliceGUI.java and BobGUI.java respectively, it is easier for you to use NetBeans IDE for creation of these files). In this example, the purpose of the GUIs is to display messages sent between Bob Agent and Alice Agent (look at the examples of lab 06 above to understanding this example). We define a method called printOut(String s) inside each agent. This method is declared as public static void so it can be called any where using class reference. There are two other important methods defined inside the GUI files: displayOnTxtArea(String s) and btnSendActionPerformed(java.awt.event.ActionEvent evt). The former is to actually display a string in a text box. The later is to cause its agent to issue the event sendMessage(String s).
|
09 |
|
|
|
|
|
|
|
|
|