PLANit Default Output Data format (XML/CSV)
In this section of the manual we discuss the Default output format used by PLANit. PLANit’s native output format is a combination of meta-data provided in XML and raw results provided in CSV. This allows you to leverage the flexibility of processing and analysing CSV results with any tool that you like (Excel, Matlab, R, etc.) while still having supplementary information about the origins of this data in the XML meta data.
Here we only focus on the structure of the data formats . If the reader wants to know how to set up an assignment using input/output files of a specific format, we refer to the reference documentation on the Java and Python API for more detailed information.
Outputs for link (segments), paths, and Origin-Destinations (ODs) must be activated, otherwise they will not be generated by PLANit.
Outline
Each major output type has a dedicated section that details the supported output properties:
- Link based Output format
- Path based Output format
- Origin-Destination (OD) based Output format
Before diving into these sections however, it is advisable to quickly get acquainted with the basic concept underpinning the PLANit hybrid XML/CSV output approach.
XML meta-data
Each PLANit run will generate a single XML meta-data output file per activated output type (link, od, path, etc.), per time period. This meta-data file details information on the configuration of the PLANit run, as well as meta-data on the output results’ properties present in the CSV outputs. In other words, each of the columns that is present in the CSV result file, will have corresponding meta-data in the XML file. This way you can always identify the unit and type of the values that is included in the CSV.
The structure of the XML meta-data is the same for all currently available output types. For a detailed description of this structure, see:
CSV raw data file
Each PLANit run generates one or more CSV output files for active output types (link, od, path, etc.). The column headings in each of the CSVs relate to the columns defined in the XML meta-data. Depending on what output type the CSV represents, different columns, i.e, output properties, are supported. Note that this is also contingent on what traffic assignment method is adopted.
Minimum example
Let us provide you with a very basic example of what a link segment results file (XML and CSV) might look like. An expanded example can be found in the XML meta-data section.
The meta-data details for this example:
- Time stamp, when the results were generated
- Version, PLANit version used
- Output configuration, information on (some) of the major components used in the run
- Simulation information, what iterations (if any) are stored in what CSV file
- Column meta-data, CSV column meta-data information
In this particular example, we only activated link segment (internal) id, the mode (internal) id, and the flow rate on the link segment. So, these will the be the only columns available in the csv
<?xml version="1.0" encoding="ISO-8859-1"?>
<metadata
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="<path_to>linkmetadata.xsd">
<timestamp>2019-02-05T11:38:24</timestamp>
<version>0.0.1</version>
<description>description of this particular link output</description>
<outputconfiguration>
<assignment>traditional static assignment</assignment>
<physicalcost>BPR</physicalcost>
<virtualcost>fixed</virtualcost>
<timeperiod>
<id>1</id>
<name>morning peak 6-9</name>
</timeperiod>
</outputconfiguration>
<simulation>
<iteration>
<nr>1</nr>
<csvdata>"<name_of_the_csv_output_file>.csv"</csvdata>
</iteration>
</simulation>
<columns>
<column>
<name>link segment id</name>
<unit>none</unit>
<type>integer</type>
</column>
<column>
<name>mode Xml id</name>
<unit>none</unit>
<type>string</type>
</column>
<column>
<name>flow</name>
<unit>veh/h</unit>
<type>float</type>
</column>
</columns>
</metadata>
Below an example of what the related CSV file might look like given this meta-data configuration:
Link Segment Id, Mode Xml Id, Flow
4,car,1800.0000000
6,car,900.0000000
8,car,900.0000000
13,car,1800.0000000
16,car,1800.0000000
20,car,1800.0000000
26,car,1800.0000000
29,car,1200.0000000
36,car,600.0000000