简体   繁体   English

Jade 中的两个容器以及不同设备之间的通信

[英]two containers in Jade and communication between different devices

I am currently studying Jade.我目前正在学习翡翠。 I found that there was only a little information about Jade.我发现关于Jade的信息很少。 May I ask two questions?我可以问两个问题吗?

  1. How to build a second container in Eclipse or Netbeans?如何在 Eclipse 或 Netbeans 中构建第二个容器?
  2. How to enable communication between two different devices, such as one computer and one raspberry pi?如何启用两个不同设备之间的通信,例如一台计算机和一个树莓派?
  1. Regarding container creation (assuming you already have a main container somewhere):关于容器创建(假设您已经在某处有一个主容器):

     Runtime rt = Runtime.instance(); String containerName; ProfileImpl pContainer; ContainerController containerRef; //create the container containerName="Mycontainer1"; pContainer = new ProfileImpl(PLATFORM_IP, PLATFORM_PORT, PLATFORM_ID); pContainer.setParameter(Profile.CONTAINER_NAME,containerName); //link it to the platform System.out.println("Launching container "+pContainer); containerRef = rt.createAgentContainer(pContainer);

    For a fully working example: https://startjade.gitlab.io/CreatePlatform/对于一个完整的工作示例: https://startjade.gitlab.io/CreatePlatform/

  2. If the devices can communicate freely and you want them to be part of the same jade instance, just deploy a container on the pi (for example), and make it connect to the mainContainer on your computer.如果设备可以自由通信并且您希望它们成为同一个翡翠实例的一部分,只需在 pi 上部署一个容器(例如),并使其连接到您计算机上的 mainContainer。 The agents on the platform will then be able to communicate with each other regardless of their location.然后,平台上的代理将能够相互通信,无论其位置如何。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM