Re: Fw: [jade-develop] containers


Subject: Re: Fw: [jade-develop] containers
From: John J. Mikucki (jjm7570@cs.rit.edu)
Date: Wed Aug 14 2002 - 15:25:32 MET DST


Thus spake Alexander Osherenko (a.ocherenko@gmx.de):

> Is it possible to get a list of containers that I can check whether
> a container is available or not and add new agents to the existing
> container?

I think you want a QueryPlatformLocationsAction. It lives in the
JADEAgentManagement namespace in 2.6. Something like the following
code would kick things off...

            ACLMessage request = new ACLMessage(ACLMessage.REQUEST);
                request.clearAllReceiver();
                request.addReceiver(a.getAMS());
                request.setLanguage(FIPANames.ContentLanguage.FIPA_SL0);
                request.setOntology(MobilityOntology.NAME);
                request.setProtocol("fipa-request");
                // creates the content of the ACLMessage
         
                try {
                        Action action = new Action();
                        action.setActor(a.getAMS());
                          action.setAction(new QueryPlatformLocationsAction());
                          cm.fillContent(request, action);
                        a.Send(request);
                } catch (Exception e) {
                        System.err.println("RHL had exception: ");
                        e.printStackTrace();
                }

Of course, if someone knows a better way, I'm all ears.

John

-- 
Avoision, n:  Avoidance, as practiced in 'Joisey.



This archive was generated by hypermail 2a22 : Fri Aug 16 2002 - 18:45:42 MET DST