下面是我的代码,其中管理器类(非jade程序)在已经运行的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 - 03 5:25:21 PM jade.core.mobility.AgentMobilityService$CommandSourceSink handleInformMoved
严重:目标localhost:1099/JADE不存在或不支持移动性
请帮助解决这个问题。提前感谢!
发布于 2015-03-05 07:22:29
Jade不支持平台间的移动性。根据JADE Programmer’s Guide的说法
使用JADE,应用程序开发人员可以构建移动代理,这些代理能够跨多个网络主机迁移或复制自身。在这个版本的JADE中,只支持平台内的移动性,即JADE移动代理可以在不同的代理容器之间导航,但它被限制在单一的JADE平台
上
https://stackoverflow.com/questions/28831786
复制相似问题