Export data

The simulator provides tools for exporting data automatically. An export section on the simulation file instructs which data is considered interesting, and should be thus exported with the selected sampling frequency. Data can be exported separately for each node, or can be aggregated on the fly using any univariate statistic function (e.g., mean, sum, product, percentile, median…). The treatment of missing or non-finite values can be specified as well. Results are exported in comma-separated values files, easily importable in a variety of data analysis tools.

Data export is realized by Exporters. Exporters are defined in the export section of the configuration, by specifying their type, their constructor parameters, and the data they should export. The elements under data must be instanceable implementations of Extractor.

Export data as CSV

Alchemist can export data to a custom comma-separated-values format. This is the classic way data is exported from the simulator, and relies on CSVExporter.

Examples

  • Export of the output of a Protelis program every 3 simulated seconds:
    Click to show / hide code
  • Export data to both a csv file and a MongoDB instance:
    Click to show / hide code
  • Export of the MeanSquaredError of some custom properties:
    Click to show / hide code
  • Export of the output of a Protelis program, values generated from nodes get accumulated into mean, max, min, variance, and median:
    Click to show / hide code

Export data to a MongoDB instance

Alchemist can send data directly to a pre-existing MongoDB instance through its MongoDBExporter.

Examples

  • Export data to both a csv file and a MongoDB instance:
    Click to show / hide code
  • Export of the output of a Protelis program, values generated from nodes get accumulated into mean, max, min, variance, and median:
    Click to show / hide code