1

I am working on jade for multiple agent platform in my project.

I have a main container and agent container which contains agents.

I want to send data from agent to agent container or main container ..

Since my agent is a client and my main container will be a server .

In the jade architecture i understood that agent container will contain agents.

Is that possible?

I was wondering there are apis to send data among agents.

Thanks in advance

Mike Causer
  • 8,196
  • 2
  • 43
  • 63

1 Answers1

1

I am not sure what it is that you are trying to achieve. Who is the end reciepient of the ACLMessage that you are sending from the JADE agent? is it all the agents that reside in the targeted container?

Just to clarify, a container is essentially an address where agents can reside, it is not an entitiy in of itself that can post and recieve messages. Within the JADE framework, Agents feature an 'Inbox' for ACLMessages, basically a BlockingQueue Object that contains a list of recieved messages. the agent is able to observe its own list and treat them as its lifecycle proceeds. Containers do not feature this ability.

ACLMessages can be directed at specific agents by adding receipients and other details. An Agent that is recieving messages can listen for specific ACLMessages by utilizing a MessageTemplate where you can specifically select messages from the agent's 'inbox' based on match criteria, for example :

Messagetemplate mt = MessageTemplate.MatchPerformative(ACLMessage.INFORM);
ACLMessage msg = myAgent.receive(mt);

will allow the the agent to take the next ACLMessage.INFORM message from its'inbox'.

for further abilities, I suggest you go through the jade API.

Also, for what i believe you are trying to achieve which is send a message to all agents within a container. You can query the AMS agent for a list of agents that is on the platform and then filter them by ContainerID. here is some code to get you started:

AMSAgentDescription[] agents = null;
SearchConstraints sc = new SearchConstraints();
// if multiple searchs are done, isolate them based on the name of searching agent
sc.setSearchId(getAID().getName());
sc.setMaxResults(new Long(-1)); // long value of -1 means get all agents
agents = AMSService.search(this, new AMSAgentDescription(), sc); //Query AMS agent for available agents

This code will retrieve a list of the all the available agents on platform that are registered with the AMS agent. Good luck and post if you have any issues :)

  • Hey, could you clarify what do you mean by "Agents feature an 'Inbox' for ACLMessages, basically a BlockingQueue Object that contains a list of recieved messages"? is an actual implementation of a `BlockingQueue` or is it just a concept? Also what will happen to the messages if one agent sends a lot of ACLmessages to another agent. –  Jun 17 '18 at 19:34