In this assignment we will learn how to develop service-oriented applications based on the Agent metaphor. Intuitively, each service is an agent. An enterprise is represented by an agent. Thus, among other things, agents embody the decision-making processes of the enterprises they represent. You would normally encode the decision making logic of the agents in rules, but for simplicity we will hardcode them into the agents. We will also learn how Semantic Web can be used to resolve heterogeniety in message parameters.

Tools

Tutorials

Buyer / Seller Interactions

Below are the set of allowed interaction scenarios of the purchase protocol (all parameters are Strings)....

For simplicity, all the messages sent must be JADE ACLMessage instances with FIPA INFORM performative. The exception to this rule is the requestForQuote message which must be sent with the FIPA CFP performative. Each seller agent registers itself with the DF (Directory Facilitator) service. The buyer agent looks for seller agents, sends a requestForQuote(itemId), and receives a quote(itemId, price) from each of them. The buyer agent accepts the smallest of the received quotes and proceeds according to one of the two diagrams above (upper left or upper right). Once the buyer agent finishes the interaction with the selected sender agent, it sends a rejectQuote(itemId, price) to other seller agents (as in the lower left part of the above diagram). The interactions can be graphically observed in RMA (Remote Management Agent) by adding a sniffer agent. A typical interaction with three sellers should look like this.

However, agents' information systems may not agree on the message names (you can assume that the names of the message parameters do not change). Each message in our assignment is an instance of this class. It essentially is a message name and a collection of parameter names and parameter values. All agents must understand the message and parameter names from the above scenarios.

Hence, after receiving a message, an agent determines if it understands the message by seeing...

  1. If the message is from the above scenarios then they are understood.
  2. If a message name is not from the above scenarios but the commonly available OWL ontology describes them as the same concepts, then they are also understood. For example, if the message received is of type payByCredit and the receiver was expecting a message of type payment, then according to the ontology provided the receiver should accept the message.
  3. If the above steps fail then the message is not understood.

If a message is understood, the agent responds according to the protocol. If not, the agent responds with the "UNKNOWN" message with a single parameter that names the part that was not understood. Upon sending or receiving an UNKNOWN message the agent is to immediately terminate the conversation. In other words, if one of the agents violates the protocol, then the other agent informs it of the violations and terminates the conversation.

Conventions

To ensure compatibility, please follow these conventions in your agents.

  1. The seller agent in the DF registry must have type = "SELLER".
  2. The seller agent must be able to handle concurrent interactions with multiple buyers. (HINT: use conversationID)
  3. The seller agent will generate a random price between $1 and $100.
  4. The seller agent must follow these rules when receiving an acceptQuote message...
  5. The buyer agent must follow these rules after sending an acceptQuote message...
  6. The buyer agent must use the itemID that is provided by argument[1] at startup.
  7. The agents print the messages they send and receive to the console.
  8. The agents will use behaviors (java classes) to handle the execution of the protocol.
  9. The agents will only pass instances of P5Message as the message contents.
  10. The ACLMessages will all use the INFORM performative with the exception of requestForQuote which will use CFP.
  11. The agents will use a common ontology which is available here.
Everything else is limited only by your imagination.

Getting Started

Here is a helpful outline to get you started...

  1. In the directory [jade-3.6 install location]/jade-bin-3.6/jade run 'java -jar lib/jade.jar -nomtp -gui' to start JADE
  2. Create an java project in eclipse called [unity_id]_soc_p5
  3. Follow the JADE tutorials and create a simple agent (i.e. java class)
  4. In Eclipse go to Project --> Properties --> Java Build Path and add all of the jars from the jade-bin-3.6/jade/lib directory
  5. In Eclipse go to Run --> Open Run Dialog... and create a new launch configuration
  6. In the configuration set the project to [unity_id]_soc_p5 and the main class to "jade.Boot"
  7. In the configuration arguments tab put "-container [localJADEName]:[yourPackage.yourAgentClass]([arguments])"
  8. When JADE is running you can run this launch configuration to add your agent to the JADE runtime.
  9. You can now go to the JADE RMA GUI and see that your agent is listed inside a newly created container.
  10. Now you can begin coding the remainder of your assignment which includes tasks like...

Deliverables

Submit a single eclipse project called [unity_id]_soc_p5 containing the buyer and the seller agents. Also include a README file with the names of your group members and any other information you feel will be beneficial to understanding and running your assignment.

Testing and Grading

We will run our own buyer and seller agents against your submitted seller and buyer agents, respectively.We may change the relationships among the concepts in the commonly available ontology to see if your agents make the right inferences about understanding or not understanding the messages.

  1. We will run your buyer and seller agents against each other and observe the outputs in their respective consoles and also through RMA sniffer graphically.
  2. We will run our own buyer and seller agents against your submitted seller and buyer agents, respectively.
  3. We will run multiple seller agents concurrently against your one buyer agent.
  4. We will run multiple buyer agents concurrently against your one seller agent.
  5. We will have our buyer and seller agents use different combinations of messages (both conforming to and violating the onotology) to ensure your agents make the correct inferences from the ontology.
NOTE: When testing we will never run buyer(pay) with seller(goods) or vice versa because this situation would cause deadlock and we have not asked you to implement timeouts.