Skip to content
Leonardo Sarmiento edited this page Jul 20, 2021 · 9 revisions

TRAILS is a mobility model that mimics the spatial dependency, geographic restrictions, and temporal dependency from real scenarios. Additionally, with TRAILS, it is possible to scale the number of mobile users and simulation time.

We implemented the TRAILS mobility model in two phases. The first phase is the TRAILS generator, a python program that exports a TRAILS mobility graph as two CSV tables (one for POIs and one for links). The second phase consists of a mobility simulator implemented in Omnet++. The simulator loads a TRAILS graph and simulates the mobility model.

TRAILS graphs are composed of two CSV files. The first file describes the parameters of POIs (POIs.csv). The second file portrays the parameters of every link (Links.csv).

TRAILS generator

The TRAILS generator creates a TRAILS graph based on traces from real scenarios and configuration parameters such as the POI's maximum diameter (SR) and the minimum time interval spent in a POI by a mobile user (TR). We implemented the TRAILS generator in Python3.8.

Software design

To have a modular TRAILS generator, We implemented five operation modes. A different python module executes each mode.

  • The ProcessTraces.py file imports recorded traces from the input folder. Thus, it is possible to import traces with the formats of the trace sets dataset ncsu, dataset roma, dataset epfl. The module filters the trace sets, and it transforms the traces into a format compatible with the TRAILS generator.

  • PlotTraces.py file imports traces prepossessed by the module ProcessTraces.py. Then, it plots the traces and saves the Plot as a PDF file.

  • The file GenerationTRAILS.py imports traces prepossessed by the module ProcessTraces.py, and it generates the files POIs.csv and Links.csv.

  • The file PlotTRAILS.py imports a TRAILS graph (POIs.csv, Links.csv) from the input folder. It plots the TRAILS graph, and saves the Plot PDF file.

Configuration parameters

The configuration parameters of the TRAILS generator are described in _operations.py. There are 14 parameters organized in four different objects.

  • InOutFiles: Object with file's directories.

    • inFolder: Parameter with the input directory.
    • outFolder: Parameter with the output directory.
  • TraceParameters: Object with parameters to process traces.

    • traceType: Parameter to select the format of the imported traces. The values are 0, 1, and 2 are used to import traces with the format of the trace-set dataset ncsu, dataset roma, dataset epfl accordingly.
    • MaxV: Velocity threshold in meters/second to remove noise in traces.
    • MaxD: Distance threshold in meters to remove noise in traces.
    • resolution: Set a new resolution in meters for the coordinates of the traces.
  • TrailsParameters: Object with parameters to generate TRAILS graphs.

    • SR: Spatial range in meters used to form POIs.
    • TR: Temporal range, the minimum time for a valid POI.
    • MinU: Distance threshold to detect broken links.
  • PlotParameters: Object with parameters to represent traces and TRAILS graphs graphically by using the MatPlotLib library.

    • POISize: Size of the figure in dots representing POIs in meters.
    • arrowSize: Size of the arrows in dots used to describe the direction of links.
    • lineWith: Width of the line in dots representing a link or a trace.
    • dpi: Plot resolution in dots per inch.
    • fSize: Plot Size (width,length) in inches.

TRAILS simulator

The TRAILS simulator was developed in the C++ 11 standard. The simulator is implemented as an extension of the mobility packet of the INET framework, and it is executed under Omnet++. The TRAILS simulator inherits the LineSegmentsMobilityBase class of the INET framework to simulate movement.

The TRAILS simulator is composed of two modules. The first module, called Coordinator, loads a TRAILS graph, and it gives instructions to each simulated user depending on the user's state. The second module, called User, simulates a user that starts at a random POI, and then it follows the instructions received from the module Coordinator. The modules are inside the INET framework in $INET_PATH/src/inet/mobility/trails$.

Configuration parameters

The following parameters are used to configure the TRAILS simulator. The configuration parameters are defined in the Coordinator module (coordinator.ned).

  • enable: if this parameter is true, it enables the coordinator module.
  • trailsFolder: Input folder where POIs.csv and Links.csv are saved.
  • includeUnrealistic: if this parameter is true, it includes unrealistic links in the TRAILS graph.

Analyze results

To record user's contacts from TRAILS simulations the tool MobilityModelCheck in combination with the TRAILS simulator in OMNet++, and to perform statistical analysis of results you can use the python scripts in the directory "analyzeResults".