Re: [jade-develop] RE: getContainer


Subject: Re: [jade-develop] RE: getContainer
From: Alexander Osherenko (a.ocherenko@gmx.de)
Date: Sun Sep 08 2002 - 10:20:06 MET DST


I'm sorry there is a bug in my implementation. Everything works fine and is visually really amazing on the RMA GUI but e.g. you can't send messages to the agents. The agents are not found. How could I solve this problem?
  ----- Original Message -----
  From: Alexander Osherenko
  To: JADE
  Sent: Friday, September 06, 2002 3:03 PM
  Subject: [jade-develop] RE: getContainer

  The feature you are speaking about I had already implemented. I set the container name in the profile in the createAgentContainer method (the CONTAINER_NAME property).

  I've also implemented the feature that if you try to create a container with an existing name you get the existing container. It is not pretty elegant, but it works. Anyway you must be sure that you don't create a container using an existing name.
    ----- Original Message -----
    From: Bellifemine Fabio
    To: Alexander Osherenko
    Sent: Monday, September 02, 2002 9:54 AM
    Subject: RE: [jade-develop] RE: getContainer

    I don't think you can do that already. I am just trying to give some hints for a good implementation of your requirement such that we can then also integrate your implementation into the mainstream of JADE.

    I think you can solve the problem of knowing the list of available containers via registering a listener.
    Then maybe you can add a method createAgent(...,...,..., ContainerID) to the class jade.wrapper.AgentContainer

      -----Original Message-----
      From: Alexander Osherenko [mailto:a.ocherenko@gmx.de]
      Sent: 31 August 2002 12:05
      To: Bellifemine Fabio
      Subject: Re: [jade-develop] RE: getContainer

      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
            ====================================================================

    ====================================================================
    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
    ====================================================================

I'm sorry there is a bug in my implementation. Everything works fine and is visually really amazing on the RMA GUI but e.g. you can't send messages to the agents. The agents are not found. How could I solve this problem?
----- Original Message -----
From: Alexander Osherenko
To: JADE
Sent: Friday, September 06, 2002 3:03 PM
Subject: [jade-develop] RE: getContainer

 
The feature you are speaking about I had already implemented. I set the container name in the profile in the createAgentContainer method (the CONTAINER_NAME property).
 
I've also implemented the feature that if you try to create a container with an existing name you get the existing container. It is not pretty elegant, but it works. Anyway you must be sure that you don't create a container using an existing name.
----- Original Message -----
From: Bellifemine Fabio
To: Alexander Osherenko
Sent: Monday, September 02, 2002 9:54 AM
Subject: RE: [jade-develop] RE: getContainer

I don't think you can do that already. I am just trying to give some hints for a good implementation of your requirement such that we can then also integrate your implementation into the mainstream of JADE.
 
I think you can solve the problem of knowing the list of available containers via registering a listener.
Then maybe you can add a method createAgent(...,...,..., ContainerID) to the class jade.wrapper.AgentContainer
 
 
-----Original Message-----
From: Alexander Osherenko [mailto:a.ocherenko@gmx.de]
Sent: 31 August 2002 12:05
To: Bellifemine Fabio
Subject: Re: [jade-develop] RE: getContainer

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 -----
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
====================================================================

====================================================================
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 08 2002 - 10:10:25 MET DST