【发布时间】:2021-09-20 13:42:05
【问题描述】:
我擅长在同一主机(我的笔记本电脑)中使用 Jade,因为我可以处理代理之间的所有交互;
但是我必须在我的笔记本电脑中运行MainContainer,并在树莓派中运行第二个容器。
我开始尝试通过创建 2 个代理来尝试一个简单的示例,第一个在主容器上,第二个在将在 Raspberry Pi 上运行的容器上。但它不起作用。
以下代码用于包含 agent1 的主容器,它将向 agent2 发送消息
Runtime runtime = Runtime.instance();
Properties properties = new ExtendedProperties();
properties.setProperty(Profile.GUI, "true");
Profile profile = new ProfileImpl(properties);
AgentContainer agentContainer1=runtime.createMainContainer(profile);
Container.start();
AgentController agent1=agentContainer1.createNewAgent("Agent1","Connexion.Agent1",new Object[]{});
agent1.start();
第二个容器的代码:
Runtime runtime=Runtime.instance();
Profile profile=new ProfileImpl();
profile.setParameter(profile.MAIN_HOST, "192.168.0.164"); //Raspberry Pi host
AgentContainer agentContainer1=runtime.createAgentContainer(profile);
AgentController agent2=agentContainer1.createNewAgent("Agent2","Connexion.Agent2",new Object[]{});
agent2.start();
agentContainer1.start();
- agent1 每 15 秒向 agent2 发送消息。
主容器代码没有任何问题,但是当我使用deployAndBrickPun (ev3dev-lang-java) 运行覆盆子容器时,它显示以下错误:
> Task :deploy
Host key checking is off. It may be vulnerable to man-in-the-middle attacks.
ev3dev#1|Sep 20, 2021 1:27:00 PM jade.core.AgentContainerImpl joinPlatform
ev3dev#1|SEVERE: Some problem occurred while joining agent platform.
ev3dev#1|jade.core.ProfileException: Can't get a proxy to the Platform Manager - Caused by: Dispatcher error - Caused by: DispatcherException in remote site. No skeleton for object-id0
ev3dev#1| at jade.core.ProfileImpl.createPlatformManager(ProfileImpl.java:529)
ev3dev#1| at jade.core.ProfileImpl.getPlatformManager(ProfileImpl.java:442)
ev3dev#1| at jade.core.ProfileImpl.getServiceManager(ProfileImpl.java:456)
ev3dev#1| at jade.core.AgentContainerImpl.init(AgentContainerImpl.java:347)
ev3dev#1| at jade.core.AgentContainerImpl.joinPlatform(AgentContainerImpl.java:495)
ev3dev#1| at jade.core.Runtime.createAgentContainer(Runtime.java:127)
ev3dev#1| at Connexion.Container1.main(Container1.java:17)
我需要解决这个错误,所以我请求你的帮助;
提前谢谢你。
【问题讨论】:
标签: java containers hosts agents-jade multi-agent