Skip to content

Simulation and Optimization Environment

Davide Conzon edited this page Feb 13, 2020 · 4 revisions

Simulation and Optimization Environment architecture

The distributed architecture of the Simulation and Optimization Environment uses a network socket-based approach to allow distribution of the Simulation Tools (ST)s among different machines, called Simulation Servers (SS)s. The communication is managed by a central broker, which keeps track of the available STs. For the discovery of the Simulation Managers (SM)s, this architecture introduces a setup phase, where the STs, through their SMs (i.e. Stage Simulation Manager or Gazebo Simulation Manager), announce themselves and their capabilities. This allows the other tools to maintain an updated list of available STs, also during the optimization phase. The architecture is based on a distributed approach: the Optimization Tool (OT) sends the controller to the STs, avoiding the exchange of messages between them. The STs can thus perform the simulation stand-alone, without the need to interact with the OT, during the simulation. This reduces considerably the number of exchanged messages. This architecture is composed of four main components, as shown in the figure below:

  • The previously mentioned OT, which is responsible for performing the evolutionary optimization.
  • Several STs, distributed on different machines, called SSs, each one wrapped by a SM. This latter component is a software layer installed on the SS that implements the network interface and acts as a client that connects the ST to the broker. This allows the {OT to communicate with the STs, without knowing the exact type of ST used.
  • The Simulation and Optimization Orchestrator (SOO) oversees all the SMs and coordinating the simulation and optimization tasks. It maintains a list of available SMs, together with the capabilities of the STs that they wrap. When it is launched, the user can indicate the requirements for the ST to be used, like dimensionality or minimum CPS cardinality. In this way, the SOO can select SMs that fulfil the requirements.
  • Finally, the broker that handles all communication between the other components.

This figure shows the network-based architecture consisting of the components SOO, broker, OT, and SSs.

architecture

To be able to use the Simulation and Optimization Environment, the user needs to install one instance of XMPP server that needs to be accessible to all the machines that will be used. The software has been tested with Openfire and Tigase, two popular opensorce resources (currently, the latter one is the choice suggested). Both the servers are well documentated and provide instructions to install them on several platforms. Once installed the server, the user will n eed to configure all the components to use it (to do this, follow the instructions for the configuration of each component). Once the server is configured, the last thing needed, to allow the components to connect, is to extract the certificate from the XMPP server and install it in the machines where the components are running. Follow this guide to extract and impport the certificate.

The Simulation Managers can be deployed in two ways:

  • The artifacts can be installed directly in a machine where all the other ROS packages are already installed and run manually.
  • The user can build a docker image of its simulation (follow this guide to setup an environment for this) following the instructions indicated in the Simulation Managers example folders (see here and here) and leveraging the docker images prvided on Dockerhub. Then, this image can be deployed manually or automatically using the SOO and its Kubernetes integration. Kubernetes allows creating a cluster of machines to be used as Simulation Servers and using them to deploy automatically the Simulation Managers. To setup a cluster, you can follow this guide and to add one your machine to an existing cluster, you can follow this guide.

Once that the Simulation and Optimization Environment is setup, it is possible to start an Optimization/Simulation task. For monitoring the optimization, the Simulation Managers can be configured to public the results of each simulation on one MQTT server, in this way, it is possible to simply integrate this with a dashboard, i.e. Thingsboard that allow monitoring the optimization process. Follow this guide for Thingsboard integration.

Getting Started

Clone this wiki locally