0

I'm looking to build a multi agent system for an hospital with multiple patients that ask services to the hospital. I started programing this system by construction the patient class that inherits jade's agent properties but I'm having an hard time finding out what DFAgentDescription and ServiceDescription are supposed to do exactly.

Can someone please explain it ?

Thank you

1 Answers1

1

From JADE tutorial:

For each published service a description is provided including the service type, the service name, the languages and ontologies required to exploit that service and a number of service-specific properties. The DFAgentDescription, ServiceDescription and Property classes, included in the jade.domain.FIPAAgentManagement package, represent the three mentioned abstractions. In order to publish a service an agent must create a proper description (as an instance of the DFAgentDescription class) and call the register() static method of the DFService class. Typically, but not necessarily, service registration (publication) is done in the setup() method as shown below in the case of the Book seller agent.

If I want to describe it as simple as possible, every agent which offers a service should register its service in the yellow pages (called Directory Facilitator or DF in JADE and each platform have at least one DF), so the other agents in same platform can search for it.
For registering in DF, you need to create a ServiceDescription, this usually done in setup method of agents:

protected void setup() {
    ...
    // Register the book-selling service in the yellow pages
    DFAgentDescription dfd = new DFAgentDescription();
    dfd.setName(getAID());
    ServiceDescription sd = new ServiceDescription();
    sd.setType("book-selling");
    sd.setName("JADE-book-trading");
    dfd.addServices(sd);
    try {
        DFService.register(this, dfd);
    }
    catch (FIPAException fe) {
        fe.printStackTrace();
    }
    ...
}
Ehsan Khodarahmi
  • 4,772
  • 10
  • 60
  • 87
  • Thanks @Ehsan Khodarahmi, Your explanation is 10 times better and clearer than the one in the JADE Tutorial. For starters I finally understood WHY operations pointed out in the tutorial are done ... Thanks once again! :) – Michał Mirowski Oct 18 '20 at 15:27