【问题标题】:Jade Framework (two containers)Jade 框架(两个容器)
【发布时间】: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


    【解决方案1】:

    您的个人资料中缺少信息。

    1. 您需要在两个(主容器和远程容器)上定义 IP、端口、主机名。不在 main-c 上执行它会创建 pb 以使其运行,但您将无法从 pi 加入它。

    2. 在 pi-container 上给出的 IP 应该是主容器之一。不确定您的示例中是否属于这种情况。

    您可以查看旨在提供几个运行示例的开源项目startJade。 “平台创建”示例涵盖了这种情况。

    【讨论】:

      猜你喜欢
      • 2017-06-20
      • 1970-01-01
      • 1970-01-01
      • 2013-09-05
      • 2017-05-24
      • 1970-01-01
      • 2011-02-22
      • 2011-11-10
      • 2022-01-26
      相关资源
      最近更新 更多