Algorithms Development

Huxon Platform decouples the logic of the algorithms from how they are implemented on the target architecture. You are in charge of defining the logic of the algorithms without worrying of the target architecture, while Huxon automatically partitions your code, decides which hardware suites best for each code portion and deploys each code portion on nodes of the target architecture by taking into account resource and communication constraints.

Algorithms can be developed and simulated on your local machine, but need to be uploaded on Huxon to make them available for deployment.

Code development

Algorithms Page

Algorithms needs to be developed using Huxon Language based on C++.

To ease the process of developing algorithms on your local machine, it is possible to download a development kit from Huxon. The DevKit comes with a development container for Visual Studio Code with all the needed software installed. You can download the DevKit from here or inside Huxon by clicking on DOWNLOAD DEVKIT. To develop using the DevKit:

Algorithms development in Visual Studio Code
  • Click on Reopen in Container in the lower right part of the screen. Visual Studio Code will reopen, and by clicking on the popup you can see the progress of the setup.

DevContainer Build
  • When the build is over, you can open a new terminal to use a development tool available inside the container called huxc.

huxc provides commands to create, simulate and delete your project. The structure of the command for huxc is:

huxc create | simulate | delete -n <project_name>

Note

huxc also provides the arff2hpp command can be used to train a decision tree starting from a ARFF dataset and generate a corresponding header file that can be used inside your algorithm to run the decision tree when needed. This is especially useful for classifying patterns from features extracted from the sensor’s data. For more information on the command run huxc arff2hpp -h

Upon project creation, the tool creates a folder with name huxapp_<project_name> and automatically generates an example code that you can use as a starting point. The DevKit contains also a docs folder containing the full documentation of the language.

DevContainer Build

Once the code is ready for deployment, you can use the package functionality to create an archive that can be uploaded to Huxon.

Note

Remember to simulate locally the correctness of the code to validate its functionality.

Algorithms Upload

algorithm upload

The archive of the algorithms can be directly uploaded to Huxon by clicking on NEW ALGORITHM UPLOAD and providing the archive, and the name of the algorithm (this is the name that will be showed in the internal library of algorithms). Optionally, you can also specify a description for the algorithm.

By clicking on SUBMIT the code is uploaded, and Huxon starts analyzing the code to determine performance requirements and various metrics that will be necessary to Huxon to execute this code on any defined target architecture.

algorithm upload

Once the algorithm is ready, its status turns green and become visible in the Virtual Sensor Development section of Huxon.

Interaction with Azure Central

Among the various analysis performed by Huxon on the algorithm, Huxon interfaces with the Azure Central Application specified during project setup, and creates a Device Template corresponding to your algorithm using the Digital Twin Definition Language (DTDL). This operation allows to interface with the meaningful data generated by your algorithm directly inside Azure Central, or to connect to a third-party software to export data or to generate data visualizations.

algorithm upload

You will be able to see the generated DTDL directly from the Device Templates of your Azure Central Application.