1

I'm a beginner in the development of multi agent systems in JADE, I've been reading some tutorials about it, but I still have a doubt, every tutorial show how to register o how to search a service in the DF, for what I know a service should be a action right? If the agent offers a set of services there should be a way that when other agents request one of the service I execute some code for the requested service. I have a list of methods that are related to a service, but, in JADE:

  1. how I program the action of a service?
  2. how I call the methods related to the service?

Thanks!

Mike Causer
  • 8,196
  • 2
  • 43
  • 63
Sredny M Casanova
  • 4,735
  • 21
  • 70
  • 115

1 Answers1

0

If i understand correctly you are asking how to get to know a particular service and use it ? For example the Book-Trading example in the jade example set, The book seller when it registers with the DF sets it as sd.setType("Book-selling") and when the Book Buyer needs to find some sellers, it searches again with // Update the list of seller agents

DFAgentDescription template = new DFAgentDescription();
    ServiceDescription sd = new ServiceDescription();
    sd.setType("Book-selling");
    template.addServices(sd);
    try {
      DFAgentDescription[] result = DFService.search(myAgent, template);

So only those services which match the specified template will be able to offer their services to the book buyer agent. So therefore you would need to register your specific service with the DF in order to be visible to other agents who could use them.

  • No, I registered sucesfully the service, the thing is where Do I should put the service code? For example an agent that offers ServiceA and ServiceB whre should I program the logic of each service? Every service runs as a behaviour? Thanks! – Sredny M Casanova Oct 16 '15 at 03:45