【发布时间】:2015-03-03 12:24:56
【问题描述】:
这是我的代码,其中管理器类(非玉程序)在已经运行的 JADE 平台上成功创建了一个代理,但不会将该创建的代理迁移到另一个平台。
Manager.java
public class Manager
{
public static void main(String args[])
{
Runtime myRuntime = Runtime.instance();
myRuntime.setCloseVM(true);
Profile myProfile = new ProfileImpl();
myProfile.setParameter(Profile.MAIN_HOST, "192.168.2.9");
myProfile.setParameter(Profile.MAIN_PORT, "1099");
ContainerController myContainer = myRuntime.createAgentContainer(myProfile);
try
{
myContainer.createNewAgent("agent_007", agent_hun_main.class.getName(), null);
} catch (StaleProxyException e) {
e.printStackTrace();
}
try
{
myContainer.getAgent("agent_007").start();
} catch (StaleProxyException e) {
e.printStackTrace();
} catch (ControllerException e) {
e.printStackTrace();
}
}
}
agent.java
public class agent extends Agent
{
public void setup()
{
System.out.println("hie i am an agent");
System.out.println(this);
AID remoteAMS = new AID("ams@localhost:12341/JADE", AID.ISGUID);
remoteAMS.addAddresses("http://192.168.2.9:7778/acc");
PlatformID destination = new PlatformID(remoteAMS);
this.doMove(destination);
}
}
这是我在执行项目时遇到的错误:-
2015 年 3 月 3 日下午 5:25:21jade.core.mobility.AgentMobilityService$CommandSourceSink handleInformMoved
严重:目标 localhost:1099/JADE 不存在或不支持移动性
请帮忙解决这个问题。 提前致谢!
【问题讨论】:
-
你好 stackoverflow !我想这是一个活跃的社区还是相反?
标签: java agent agents-jade