我假设 JADE Gui 你指的是 JADERMA http://jade.tilab.com/doc/tools/rma/html/intro.htm
由于 RMA 本身就是一个代理,因此显示 RMA gui 只需创建并启动 RMA 代理即可。
如果您通过代码(即不是通过命令行或 GUI)执行此操作,则必须引用您想要启动容器的容器控制器,并且您只需调用其上的 createAgent() 方法。
import jade.wrapper.AgentController;
import jade.wrapper.ContainerController;
...
ContainerController myContainer;
// .. load a container into the above variable ..
try {
AgentController rma = myContainer.createNewAgent("rma", "jade.tools.rma.rma", null);
rma.start();
} catch(StaleProxyException e) {
e.printStackTrace();
}
您可以从这样的代码启动主容器
import jade.core.Runtime;
import jade.core.Profile;
import jade.core.ProfileImpl;
...
Runtime myRuntime = Runtime.instance();
// prepare the settings for the platform that we're going to start
Profile myProfile = new ProfileImpl();
// create the main container
myContainer = myRuntime.createMainContainer(myProfile);
或者您可以启动一个普通的代理容器并连接到外部容器,如下所示
import jade.core.Runtime;
import jade.core.Profile;
import jade.core.ProfileImpl;
...
Runtime myRuntime = Runtime.instance();
// prepare the settings for the platform that we're going to connect to
Profile myProfile = new ProfileImpl();
myProfile.setParameter(Profile.MAIN_HOST, "myhost");
myProfile.setParameter(Profile.MAIN_PORT, "1099");
// create the agent container
myContainer = myRuntime.createAgentContainer(myProfile);
参考:使用 JADE 开发多代理系统、Fabio Luigi Bellifemine、Giovanni Caire、Dominic Greenwood。