Tools/TraceExporter
Contents |
From 30.000 feet
traceExporter.py' converts SUMO fcd output to different "trace file" formats, OMNET, Shawn, ns2/ns3, PHEM.
- Purpose: trace file conversion/generation
- System: portable (Linux/Windows is tested); runs on command line
- Input (mandatory): SUMO fcd-output
- Output: One or more "trace file(s)" and other complementary files
- Programming Language: Python
Introduction
Different applications read "vehicular traces", files containing mainly positions of vehicles over time. [traceExporter.py] generates such files by converting SUMO's fcd output into several supported formats. Following files can be generated, sorted by application:
- OMNET: mobility-traces (.xml)
- Shawn: snapshot-files (.xml)
- ns2/ns3: trace-files, activity-files, and mobility-files (all *.tcl)
- PHEM: .dri-files, .str-files, .fzp-files, .flt-files
- GPSDAT (unknown)
Tools/TraceExporter succeeds the old Java trace exporter, ("traceExporter.jar").
Installation
Tools/TraceExporter comes with SUMO and is located in <SUMO_HOME>/tools/bin/. Python must be installed.
Usage Description
You convert a given fcd output into a format using a command like this:
traceExporter.py --fcd-input myFCDoutput.xml --omnet-output myOMNETfile.xml
In the case given above, a file for OMNET will be built.
In the following, the command line options are described.
Input Options
[traceExporter.py] often needs only the fcd output as input. In some cases, the network used while obtaining the [fcd-output] must be given. [traceExporter.py] gives an error message if the wanted output needs additional files, such as the network, but no such file is specified. The options for defining the input files are:
| Option | Default Value | Description |
|---|---|---|
| --fcd-input <FILE> -i <FILE> | The fcd-output - file to convert | |
| --net-input <FILE> {{Option|-n <FILE>} | The network file used; Mainly used for exporting the network |
Output Options
In the following, the output options of Tools/TraceExporter' are given, devided by the application,
PHEM
| Option | Default Value | Description |
|---|---|---|
| --dri-output <FILE> | Generates a PHEM .dri-file named <FILE> | |
| --str-output <FILE> | Generates a PHEM .str-file named <FILE>; note that the SUMO network used during the simulation must be given using the --net-input option | |
| --fzp-output <FILE> | Generates a PHEM .fzp-file named <FILE> | |
| --flt-output <FILE> | Generates a PHEM .flt-file named <FILE> |
OMNET
| Option | Default Value | Description |
|---|---|---|
| --omnet-output <FILE> | Generates a OMNET mobility trace named <FILE> |
Shawn
| Option | Default Value | Description |
|---|---|---|
| --omnet-output <FILE> | Generates a Shawn snaphot file named <FILE> |
ns2/ns3
| Option | Default Value | Description |
|---|---|---|
| --ns2config-output <FILE> | Generates a ns2 configuration file named <FILE> | |
| --ns2activity-output <FILE> | Generates a ns2 activity file named <FILE> | |
| --ns2mobility-output <FILE> | Generates a ns2 mobility file named <FILE> |
GPSDAT
| Option | Default Value | Description |
|---|---|---|
| --gpsdat-output <FILE> | Generates a GPSDAT file named <FILE> |
Processing Options
Several options allow to fine-tune the processing.
| Option | Default Value | Description |
|---|---|---|
| --penetration <FLOAT> | 1 | A float between 0 and 1, defining the probability of a vehicle to be included in the output |
| --gps-blur <FLOAT> | 0 | A float defining the !!! of the blur to apply on the vehicle positions before exporting them. |
| --delta-t <TIME> {{Option|-d <TIME>} | Defines the time sampling, if given; only every <TIME> time step will be exported. | |
| --begin <TIME> {{Option|-b <TIME>} | Time steps before <TIME> are not exported. | |
| --end <TIME> {{Option|-e <TIME>} | Time steps after <TIME> are not exported. Please note that some issues are known, here. |
Processing Options
| Option | Default Value | Description |
|---|---|---|
| --help -h | Shows a help screen. |