[jade-develop] RE: getContainer


Subject: [jade-develop] RE: getContainer
From: Alexander Osherenko (a.ocherenko@gmx.de)
Date: Sun Sep 01 2002 - 11:19:32 MET DST


Fabio,

how I can get a container to add my agents to it?

Alexander
  ----- Original Message -----
  From: Bellifemine Fabio
  To: Alexander Osherenko
  Cc: jade-develop@sharon.cselt.it
  Sent: Friday, August 30, 2002 5:49 PM
  Subject: [jade-develop] RE: getContainer

  Alexander,
  an agent can quite easily query for the containers available in a platform, see the MobileAgent example for an instance.
  However you want to do that query from an in-process entity that is not an agent.
  The MainContainer has that information while the remote containers do not.

  The best mechanism to do that is probably to the the jade.wrapper package.
  Register a listener with jade.wrapper.MainContainer and then listen for added/removedContainer events.

  [Bellifemine Fabio] -----Original Message-----
  From: Alexander Osherenko [mailto:osherenko@gmx.de]
  Sent: 30 August 2002 11:38
  To: Bellifemine Fabio
  Subject: Re: getContainer

    Hello Fabio!

    The main reason why I would implement this function is that I want to create agents in specific containers. I launch several Java consoles and create agents with different names in a container (Runtime.createContainer) with the same name. The agents are created and run but the main problem is that the agents are created in the first container and not in the corresponding one as I try to explain on the following structure:

    Platform
    ---MyContainer(1)
    ------Agent1
    ------Agent2
    ------Agent3
    ---MyContainer(2)
    ---MyContainer(3)

    I hope you can understand what I mean. Actually MyContainer(2) and MyContainer(3) should disappear cause they are empty in this structure. They do not because there is probably a link to the Agent2 in MyContainer(2) and Agent3 in MyContainer(3).

    I would like to query the Runtime instance if it has a container with a specific name and if there is the container to add an agent to this container. Something like:

    Runtime rt = new ...;
    Container c = rt.getContainer("MyContainer");
    if (c!=null) {
        //there is a container with the name "MyContainer"
        c.addAgent(myAgent);
    } else
    {
        Container newContainer = rt.createAgentContainer(profile);
        newContainer.addAgent(myAgent);
    }

    I tried to implement it myself. The problem is that I don't know how to access the JADE platform and to get the existing container names. I could work with the MobilityOntology.QueryPlatformLocationsAction but I can't get access to the AMS agent to start this query.

    Cheers

    Alexander

    ----- Original Message -----
      From: Bellifemine Fabio
      To: Alexander Osherenko
      Sent: Thursday, August 29, 2002 4:01 PM
      Subject: RE: getContainer

      Alexander, the Runtime class is intended to be used by external applications, i.e. not agents.
      Our intention was to allow these applications to launch platforms, containers, and agents.
      What is the reason why you need to get the list of container IDs?
      Also the jade.wrapper package maybe of your interest.
      cheers, fabio.
        -----Original Message-----
        From: Alexander Osherenko [mailto:osherenko@gmx.de]
        Sent: 29 August 2002 12:05
        To: Bellifemine Fabio
        Subject: getContainer

        Hi!

        I woud like to implement the getContainer-Function in the Runtime class. I don't know if you are interested in, but if you do, I would highly appreciate your tips as how would you implement it.

        I thought of something like this:

        Runtime rt ...
        ContainerID = rt.getContainers();

        to send a query on the ams agent who responds to this query with a list of available containers in the platform.

        Cheers

        Alexander

        -------------------------------------------------------------------------------

        Alexander Osherenko Tel. +49 +30 2093-3832
        Inst. für Informatik Fax. +49 +30 2093-3168
        Humboldt Universität Berlin e-mail: osherenk@informatik.hu-berlin.de
        Rudower Chaussee 25

        D-10099 Berlin http://www.informatik.hu-berlin.de/

        -------------------------------------------------------------------------------

      ====================================================================
      CONFIDENTIALITY NOTICE
      This message and its attachments are addressed solely to the persons
      above and may contain confidential information. If you have received
      the message in error, be informed that any use of the content hereof
      is prohibited. Please return it immediately to the sender and delete
      the message. Should you have any questions, please contact us by
      replying to MailAdmin@tilab.com. Thank you
      ====================================================================

 
Fabio,
 
how I can get a container to add my agents to it?
 
Alexander
----- Original Message -----
From: Bellifemine Fabio
To: Alexander Osherenko
Cc: jade-develop@sharon.cselt.it
Sent: Friday, August 30, 2002 5:49 PM
Subject: [jade-develop] RE: getContainer

Alexander,
an agent can quite easily query for the containers available in a platform, see the MobileAgent example for an instance.
However you want to do that query from an in-process entity that is not an agent.
The MainContainer has that information while the remote containers do not.
 
The best mechanism to do that is probably to the the jade.wrapper package.
Register a listener with jade.wrapper.MainContainer and then listen for added/removedContainer events.
 

[Bellifemine Fabio]  -----Original Message-----
From: Alexander Osherenko [mailto:osherenko@gmx.de]
Sent: 30 August 2002 11:38
To: Bellifemine Fabio
Subject: Re: getContainer

Hello Fabio!
 
The main reason why I would implement this function is that I want to create agents in specific containers. I launch several Java consoles and create agents with different names in a container (Runtime.createContainer) with the same name. The agents are created and run but the main problem is that the agents are created in the first container and not in the corresponding one as I try to explain on the following structure:
 
Platform
---MyContainer(1)
------Agent1
------Agent2
------Agent3
---MyContainer(2)
---MyContainer(3)
 
I hope you can understand what I mean. Actually MyContainer(2) and MyContainer(3) should disappear cause they are empty in this structure. They do not because there is probably a link to the Agent2 in MyContainer(2) and Agent3 in MyContainer(3).
 
I would like to query the Runtime instance if it has a container with a specific name and if there is the container to add an agent to this container. Something like:
 
Runtime rt = new ...;
Container c = rt.getContainer("MyContainer");
if (c!=null) {
    //there is a container with the name "MyContainer"
    c.addAgent(myAgent);
} else
{
    Container newContainer = rt.createAgentContainer(profile);
    newContainer.addAgent(myAgent);
}
 
I tried to implement it myself. The problem is that I don't know how to access the JADE platform and to get the existing container names. I could work with the MobilityOntology.QueryPlatformLocationsAction but I can't get access to the AMS agent to start this query.
 
Cheers
 
Alexander
 
----- Original Message -----
From: Bellifemine Fabio
To: Alexander Osherenko
Sent: Thursday, August 29, 2002 4:01 PM
Subject: RE: getContainer

Alexander, the Runtime class is intended to be used by external applications, i.e. not agents.
Our intention was to allow these applications to launch platforms, containers, and agents.
What is the reason why you need to get the list of container IDs?
Also the jade.wrapper package maybe of your interest.
cheers, fabio.
-----Original Message-----
From: Alexander Osherenko [mailto:osherenko@gmx.de]
Sent: 29 August 2002 12:05
To: Bellifemine Fabio
Subject: getContainer

Hi!
 
I woud like to implement the getContainer-Function in the Runtime class. I don't know if you are interested in, but if you do, I would highly appreciate your tips as how would you implement it.
 
I thought of something like this:
 
Runtime rt ...
ContainerID = rt.getContainers();
 
to send a query on the ams agent who responds to this query with a list of available containers in the platform.
 
Cheers
 
Alexander
 
-------------------------------------------------------------------------------
 
Alexander Osherenko                     Tel. +49 +30 2093-3832
Inst. für Informatik                          Fax. +49 +30 2093-3168
Humboldt Universität Berlin           e-mail: osherenk@informatik.hu-berlin.de
Rudower Chaussee 25
 
D-10099 Berlin                     http://www.informatik.hu-berlin.de/
 
-------------------------------------------------------------------------------

====================================================================
CONFIDENTIALITY NOTICE
This message and its attachments are addressed solely to the persons
above and may contain confidential information. If you have received
the message in error, be informed that any use of the content hereof
is prohibited. Please return it immediately to the sender and delete
the message. Should you have any questions, please contact us by
replying to MailAdmin@tilab.com. Thank you
====================================================================



This archive was generated by hypermail 2a22 : Sun Sep 01 2002 - 11:10:37 MET DST