简体   繁体   中英

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. May I ask two questions?

  1. How to build a second container in Eclipse or 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/

  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. The agents on the platform will then be able to communicate with each other regardless of their location.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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