Discussion:
[jade-develop] create agent and containers and mobility
Dina Shehada
2014-05-18 12:44:15 UTC
Permalink
Hello,
I am very new to jade and I've been searching the resources all over for an answer hopefully you'll be able to help me.
I want to create one agent that will migrate from container to another and all through code I keep trying creating agent through codes such as,


// Start the Main Container
Profile p = new ProfileImpl();
ContainerController mainController = Runtime.instance().createMainContainer(p);
// Create and start your agents
AgentController ac = mainController.createNewAgent("a1", "firstAgent.HelloAgent", null);
ac.start();
ac = mainController.createNewAgent("a2", "firstAgent.HelloAgent", null);
ac.start();


But the created agent are not visible any where and they don't run I keep getting the GUI (because I set the Run Configuration as -gui) which shows the main container along with the AMS/DF/.. Only, can you please let me know how to create agents and containers through the code and how to properly run it and make migrate


I really need your help!

Regards
Dina
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://avalon.cselt.it/pipermail/jade-develop/attachments/20140518/a9982390/attachment.html>
Caire Giovanni
2014-05-20 21:10:19 UTC
Permalink
Hi,

What do you mean by "because I set the Run Configuration as -gui"?

In your code you launch a main container, but since you pass it an empty profile, the platform formed by this main-container does not have any GUI. If you see a GUI (I don't know where it comes from) it refers to a different platform --> It will not show agents a1 and a2.
If you want your main-container to show a gui you must configure the profile as below:

Profile p = new ProfileImpl();
p.setParameter(Profile.GUI, "true");
ContainerController mainController = Runtime.instance().createMainContainer(p);


Bye,

Giovanni

Da: jade-develop-bounces at avalon.tilab.com [mailto:jade-develop-bounces at avalon.tilab.com] Per conto di Dina Shehada
Inviato: domenica 18 maggio 2014 14:44
A: jade-develop at avalon.tilab.com
Oggetto: [jade-develop] create agent and containers and mobility

Hello,
I am very new to jade and I've been searching the resources all over for an answer hopefully you'll be able to help me.
I want to create one agent that will migrate from container to another and all through code I keep trying creating agent through codes such as,


// Start the Main Container
Profile p = new ProfileImpl();
ContainerController mainController = Runtime.instance().createMainContainer(p);
// Create and start your agents
AgentController ac = mainController.createNewAgent("a1", "firstAgent.HelloAgent", null);
ac.start();
ac = mainController.createNewAgent("a2", "firstAgent.HelloAgent", null);
ac.start();


But the created agent are not visible any where and they don't run I keep getting the GUI (because I set the Run Configuration as -gui) which shows the main container along with the AMS/DF/.. Only, can you please let me know how to create agents and containers through the code and how to properly run it and make migrate


I really need your help!

Regards
Dina
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://avalon.cselt.it/pipermail/jade-develop/attachments/20140520/57c8096a/attachment-0001.html>
Loading...