# Aimsun Next: Emme Interface¶

Emme is a travel demand modeling system from INRO in Canada for urban, regional, and national transportation forecasting. The Aimsun Next - Emme Interface converts a traffic network from one modeling package to the other to easily interchange matrices and other data. This Interface can be used without an Emme license, but in this case it is only possible to work with text files providing input to Emme and not possible to generate the Emmebank file.

This Interface, requires a license for both Aimsun Next and the Planning Software Interface.

Note that there is a fundamental difference in how the network is modeled in each package. Aimsun Next has a detailed representation of the traffic network representing physical roads and junctions, whereas Emme adopts a more abstracted graph approach the network. The interface is designed to resolve this difference as it translates between the two network models

## Introduction¶

The main capabilities of the interface are:

• Generation of an Emme model from an traffic network in Aimsun Next
• Generation of a draft Aimsun traffic network from an Emme model
• Generation of a Traffic State in Aimsun Next from an Emme assignment
• Matrix import and export.

Detailed information about the translation process and methods used to create an Emme network, as well as the files created by this process, are explained in the Translation Process section.

The data exchanged between Emme and Aimsun Next includes the translation of the network geometry, matrix export, detection file translation, and Transit lines.

When the translation process from Aimsun Next to Emme is started, the batch input files (d211.in, d231.in, etc.) needed to generate the Emme model of the target network are created by Aimsun Next. These do not constitute the Emme network but are the building blocks for it. The Emme Interface provides an Emme databank building macro that reads the Emme input files and generates the Emmebank (An Emme license is needed for the Emmebank generation) for the target network, only then can the network analysis be undertaken in the Emme environment.

The process is reversed from Emme to Aimsun Next. Export files are generated by Emme from the Emmebank. These are read by Aimsun Next to generate a new traffic network or to populate an existing network with matrices, travel data, and transit routes from an Emme model.

## Export from Aimsun Next to Emme¶

Several export features from Aimsun Next to Emme are available from the menu File : Export : Emme Network. This option brings up the following dialog.

There are four options: - Export of the Aimsun traffic network to Emme, that is, the Geometry Export - Export of matrices - Translation of a Detection file from Aimsun format to Emme format. - Export Transit

The user can choose whether to export to EMME/2 or to Emme 3. When Emme 3 is chosen, the Ip Address and Port are needed in order to call Emme 3 (this information is not necessary if only the text files are going to be generated). This information can be found in the INROkey Server Advanced folder.

The folder where the Emme databank or files will be created must be specified in the Output textbox.

The Use External ID option exports to Emme using centroid and node External IDs instead of their internal IDs. If this option is selected, the user must ensure that all centroids and nodes have unique numerical External IDs.

### Exporting the network geometry to Emme¶

To generate an Emme databank, select the menu File / Export / Emme Network to get to the Export to Emme dialog. The folder where the Emme databank or files will be created must be specified in the Output box. To export the geometry of the network, the size of the Emme license and the name and number that will be given to the scenario of the databank to be created must be supplied.

The option Generate structure to use OD totals as counts is used when additional nodes are to be generated to link the zone to a single node rather than link it to several nodes.

Finally, the Generate automatic Emmebank option must be selected if the databank is to be automatically created. Note that an Emme license must be available to generate the Emmebank, otherwise, only the files necessary to create the Emmebank will be generated. The next figure shows the dialog filled, ready to export the geometry.

### Exporting a matrix to Emme¶

The set of current matrices defined in the Aimsun document is listed after checking the Export Matrix option in the Matrix frame. Select those to be exported to Emme.

### Converting a Detection Time Series to Emme format¶

In the Detection frame, check the Detection Translation option and specify the Time Series and interval to be translated.

Select any of the available time series either in sections or in detectors, the counts of the selected time series will be stored in a file called ‘counts.det’. Select any of the available time series in turns, the counts will be stored in a file named ‘turningCounts.det’.

And after the translation of the corresponding Time Series, the resulting file is as shown below.

If the geometry export is done with the Generate structure to use OD totals as counts option selected. The total generations and attractions by zone will be included in the Detection file.

### Exporting Transit Lines to Emme¶

To export the Transit lines, check the Export Transit option, select the Time Slice and define the Speed. The Time Slice parameter is used to select the nearest timetable (in terms of time) of each transit line, which will be exported. The Speed parameter is used to set the default speed in the Emme format.

All exported lines are stored in ‘d221.in’ file.

## Import from Emme to Aimsun Next¶

Several import features from Emme to Aimsun Next are available from the menu File / Import / Emme Network.

The option of importing the geometry of an Emme network is available provided that the network defined in Aimsun Next is new and still empty; it is not possible to import an Emme network into an Aimsun document already containing geometry data. The other three options (Matrix, Traffic State, and Transit Lines import) are always available.

The user can choose whether to import from EMME/2 or from Emme 3. When Emme 3 is chosen, the Ip Address and Port are needed in order to call Emme 3 (this information is not necessary if files are already available, it is only needed if the Generate Files option is going to be used). This information can be found in the INROkey Server Advanced folder.

The network import from Emme to Aimsun Next can automatically generate all the Emme text files containing all the data, the macros used to obtain these text files can be found here.

### Importing a Traffic Network from Emme to Aimsun Next¶

The import of an Emme network consists of the generation of three essential files and, optionally, two further files. The three essential files contain the data related to the geometry of the network (nodes and links, turns, and length and coordinate units). The first of the optional files contains data relating the Emme link type to the Aimsun road type, while the second contains the list of Volume Delay Functions and Turn Penalty Functions (VDFs and TPFs) in the Emmebank, to translate that information into the traffic network in Aimsun Next.

The network input options are only available if the current Aimsun traffic network is empty (i.e. a new Aimsun document)

The location of the Emme databank and the scenario of the databank to be used are required if the intermediate files are to be generated. If the databank is not available, but all the necessary files are, then the location of the databank can be omitted. Clicking on the Generate Files button, generates four files. These are located in the same folder as the Emme databank and named "network.net", "network.tur", "units.dat", and "vdfs.dat". They contain the nodes and links information, the turns information, the length and coordinate units, and the list of VDFs and TPFs respectively.

If these files already exist, their generation can be omitted by clicking on the Get Files button if they are located in the same folder as the Emme databank, or by setting the location of the files (in this latter case, the Emmebank and scenario do not need to be specified).

These files, except for the road type relation file, can also be generated manually. To create the files manually the user has to run Emme using the guide to the file generation of these files.

The driving side (Rule of the Road) must be specified, "Right" is the default. If the checkbox Units in Degrees is checked, the node coordinates will be interpreted as given in degrees.The Emme link user parameters "ul1", "ul2", and "ul3" are available in the network.net file, these can be stored in the Aimsun document as additional section attributes. Options are available to choose which section parameters to use to store them, additional section parameters can be generated for this task, See the types window.

The nodes and links are described in the network.net file exported from Emme, an example is shown here.

#### Turns¶

The turns are described in the network.tur file exported from Emme, an example is shown here.

#### Units¶

The units are described in the units.dat file exported from Emme, an example is shown here.

#### VDF & TPF functions¶

The VDF and TPF functions are described in the vdfs.dat file exported from Emme, an example is shown here.

As the Emme link type will be matched with Aimsun road types, the required road types should exist before importing. If the File / New (Without Template) is used, then at least one road type must be created prior to the import. Otherwise, the import cannot take place and a pop-up message with the error is shown. If the "File / New (With Template)" option is used, some default road types will already exist, they can be used with their default parameters or be modified before the import to match the link types in the Emmebank.

The Road Type file contains the correspondence between link types in Emme and road types in Aimsun Next. It is not necessary to include this file as this correspondence can be specified manually in a dialog during the import process. However, it can be useful to have this correspondence available in a file if several imports with the same relationships are undertaken. As this information is only available when the table with the correspondences is filled in, the option to create this file is in the dialog of the Road Types Relation. By default, the file will be named roadtype.dat, it will be stored in the same folder as the Emmebank and it will not be editable by the user (it is a binary file).

#### Importing the Traffic Network¶

When all the data needed for the import of the traffic network is filled in, clicking on the OK button at the bottom of the dialog brings up three task related dialogs. The first is used to set a correspondence between the parameter 'type' of a link in Emme and the type of the corresponding road section in Aimsun Next.

Because the 'type' attribute as such will not be available in Aimsun Next afterwards, it is recommended that it is used in Emme to establish a road function classification prior to starting the import process. The Save button stores this information in a file for later use.

When the road types are matched, clicking OK brings up the import volume and turn delay functions dialog.

This dialog matches each parameter referenced in the VDFs in Emme (e.g. length, lanes, ul1, ul2, ul3) with the correspondent attribute in Aimsun Next . Note that, since release 8.0.3, the importer translates the memory expressions put() and get(). but will not translate other Emme function expressions (.min., .max., .psum., .addle., .xor., bint, erf, lgam, ms, puti). Therefore, the vdfs.dat file must be manually modified prior to starting the import process. If an expression cannot be translated, the function will still be created and associated with the corresponding section, but the definition will be empty and must be supplied later.

Clicking the next button on the dialog moves to the same parameter referencing task for the TPF functions

Note that the Transit Time Functions (ft) are not imported.

### Importing OD Matrices from Emme to Aimsun Next¶

Matrices contained in an Emme network can be imported into Aimsun Next provided that the centroid configurations in both networks correspond.

If a matrix file is already available, it can be selected as the Input File. The matrices contained in the file will be listed. If no matrix file is available, choose which matrix in the Emme databank should be imported, so the number of the matrix id must be fixed. Click on the Generate Files button: a file containing the matrix will be created. This file is located in the same folder as the Emme databank named mfnn.txt

Only one matrix file at a time can be generated, but the import can be done simultaneously for as many matrices as desired, provided they are all contained in the same file.

The matrix file can also be generated by Emme.

The matrices to be imported must be checked in the list. The Initial Time, the Duration, and User Class of every matrix can be set by selecting a matrix, filling in the data and pressing the Set Values button.

The figure below is an example of a file containing an Emme matrix.

When all the data is filled in, run the import process by clicking OK. The matrix or matrices will be located in the Project: Demand Data: Centroid Configurations: OD Matrices folder, in the Project Window.

### Importing a Traffic State from Emme¶

A Traffic State import from Emme uses the results of an assignment of a matrix in an Emme network to generate a Traffic State. This requires the Emme network and the network in Aimsun Next are matched, typically one exported from the other.

The required files, "links.vol", and "turnings.vol", contain the link flows and the turn flows obtained in the assignment. They are located in the same folder as the Emmebank file. If they do not exist they can be generated from Emme using the Generate Files option. These files can also be generated manually. To create the files manually the user has to execute Emme.

Examples of the "links.vol" and "turnings.vol" that are obtained from Emme after the assignment are shown here:

When all the data needed for the creation of the Traffic State is filled in, click on the OK button and the new State will be created named "Emme Import State.in" the Project: Demands Data: Traffic States folder, in the Project Window.

### Importing Transit Lines from Emme to Aimsun Next¶

The Transit Lines defined in an Emme databank can be imported into an Aimsun traffic network.

The required file is "ptlines.out", it contains the Emme description of the Transit lines in the network. It is located in the same folder as the Emmebank file. If it does not exist it can be created using the Generate Files option. This file can also be generated manually using Emme.

An example of a "ptlines.out" file is shown here:

When all the data needed for the import of the PTLines is filled in, click on the OK button at the bottom of the dialog and the PTLines will be created in the Project: Transit: Transit Lines folder, in the Project Window.

Note that the Emme special symbol "*" for a dwell time factor will be ignored by the importer and that all stops are considered to allow boarding and alighting by Aimsun Next, so Emme special symbols > and < are considered exactly the same as symbol "+".

### Importing Detection Files¶

Detection files can be read into an Aimsun document as Real Data Sets and the data is converted to a Time Series. For more information consults the Time Series and Real Data Sets Sections

The figure below shows one of the possible formats (detector name, count, date) for a Detection File that can be read by Aimsun Next.

## Translation Process¶

### Translation from an Aimsun traffic network to an Emme network¶

The process of translating a traffic network in an Aimsun Next document into an Emme model consists of three steps:

• Translation of the Aimsun model components that have correspondence with Emme model components.
• Creation of the required Emme input files with the suitable format.
• Execution of the macros to create the Emmebank from the files.

Familiarity with the characteristics and topology of the traffic networks implemented by both models Emme and Aimsun Next is assumed in the following section. The following general rules apply to the translation:

• Aimsun sections are translated into Emme directional links
• Aimsun connections are translated into Emme links
• Aimsun nodes are translated into Emme intersections, i.e. Emme network nodes for which a turn table exists in the databank, specifying the banned turns and penalty codes for each of the allowed movements in the node
• Aimsun centroids and nodes are translated into Emme centroids and nodes with the same identifier.

The structures that represent the traffic network in Aimsun Next and in Emme have similar elements but there are some differences that must be taken explicitly into account in the translation process. The main differences are:

• Aimsun Next has identifiers for sections, nodes, and centroids while, in Emme, identifiers are only for nodes and centroids, and sections (called links) are identified by the i-node (node at the beginning of the section) and j-node (node at the end of the section).

• The sections in Aimsun Next are not always straight, they can have complex curves, but in Emme there are only straight sections.

• In Aimsun Next, centroids can be connected either from/to sections or from/to nodes. In Emme, connections are only from or to nodes and are not to sections. Also, the connection of centroids to nodes or sections in Aimsun Next is made through a special object, a connection, which is not considered as a section In Emme the connection between centroids and nodes is established by links.

To account for the differences between the network topologies used by Aimsun Next and Emme the following conventions are used in the translation:

• In an Aimsun traffic network, when working with Traffic States, there can be some input/output sections which are not connected to any centroids playing the role of sources and sinks of traffic flow. Sections of this type define the boundary of the traffic network. Such a network can also contain centroids and connections attached either to nodes or to sections. These input/output sections lack of i-node (origin node) and j-node respectively, so they cannot be translated into the Emme model, they will ‘disappear’ in the translation process.

• The connection of a centroid with an input/output section of the Aimsun network is done with a connection, no intermediate node is needed. The translator considers the connection as a link in Emme and generates a new node in between the connection and the input/output section.

• The method to translate a centroid connection from/to an internal section of the Aimsun traffic network is: If in the network, the centroid is injecting flow into the section, then in Emme it is connected to the section initial node; If in the network the centroid is collecting flow from the section, then in Emme it is connected to the section terminal node.

• The Aimsun network model allows two sections to have equal origin and destination junctions (parallel sections) whereas the Emme network model does not permit that two links have the same i-node and j-node. This conflict is solved by gathering both sections into one Emme link having an aggregated number of lanes and also an aggregated weight capacity according to the characteristics and number of lanes of each of the parallel sections.

• A section with the same initial and terminal node is eliminated in the translation to the Emme.

The next figures illustrate the above translation conventions in a simple network. They show an Aimsun network with an input section not connected with a centroid: section 151, and parallel sections: sections 107 - 108 and 110 - 111 with the corresponding Emme traffic network model generated from it.

Other rules applied to the translation are:

• All the links with the same Road Type in the Aimsun model will have the same link type in Emme.
• Link capacities are stored in Emme link user data item ul2. For connections, the capacity is set to 9999.
• Link User Defined Cost is stored in Emme link user data item ul3.
• Link IDs in Aimsun Next are stored in Emme link extra attribute @nsect.
• The volume delay function in Aimsun Next defined by section or connection will be the same in Emme.
• Turn speeds are stored in Emme turn user data item up2. For turns from/to a centroid, the speed is set to 999.
• Turn lengths are stored in Emme turn user data item up3.
• Every allowed turn will have the same turn penalty function as in the Aimsun network.

The default turn penalty functions are.

Turn Penalty      Function Index   Penalty Function

Turns incoming or

outgoing centroids      -1             Non Penalized

Banned Turn                0             Forbidden

v_max ≤ 10                 1             6*length

10 ≤ v_max ≤ 20       2             4*length

20 ≤ v_max ≤ 30       3             2.4*length

30 ≤ v_max ≤ 40       4             1.7143*length

40 ≤ v_max                 5             1.2*length

Mode c (car), corresponding to mode type auto, is always created by default in the Emmebank. Mode b (bus) is created only if Transit lines are being exported.

The files generated by the different exports are listed below:

Geometry and Transit files: d201.in d202.in d211.in d221.in d231.in d311.in d411.in counts.dat

Auxiliary Files: d002.in dsects.in errors g2m2v12.rep Identity.dat nextmod.bat turningUdc.in usemacro vdfs_relation.txt reports

Emmebank Files: emme2ban or Emmebank depending on Emme version

## Manual Generation of Emme batch files¶

### Emme network import: network.net, network.tur, units.dat, and vdfs.dat files ¶

In Emme, the method of obtaining the files is to use the following sequence of commands:

• Extracting the network nodes and links data:

• The first step is to fix the file name where the data is going to be stored:
• batchout=network.net
• Punching the information:
• 2.14: Output base network.
• 5: punch base network.
• y: all nodes.
• 7: end.
• batchout=
• Extracting the network turns data:

• Similarly to the previous procedure, the first thing to do is to fix the file name:
• batchout=network.tur
• Then the information is punched:
• 2.31: Input / modify / display turn table.
• 5: output turn table.
• 2: punch.
• y: all intersections.
• 8: end.
• batchout=
• Extracting the information about units:

• The generation of the units.dat is made by executing the following macro:
~o=39
1.23
~o|512
~o|2048
~x=10
~+;~o|2048;~>>units.dat;~"%%%t9%%%;~>;~x-1;~?x>0;~\$
~o=6
q
~/
~/1.23 data punched into file units.dat
~/
q

• Extracting the information about VDFs and TPFs:

• The generation of the vdf.dat is made by executing the following commands:
batchout=vdfs.dat
4.14
3
y
q
batchout=


This generates the first three required files and the optional vdfs.dat file, to be found in the same folder as the Emmebank.

### Emme OD Matrix: MFnn.txt¶

In Emme, execute the following commands:

• The first step is to fix the file name (for example, it can be set to mfnn.txt) where the data is going to be stored:
• batchout=mfnn.txt
• Then the data is punched:
• 3.14: Output matrices.
• 3: punch a matrix.
• mfnn: Enter: Matrix, for example, mf01 if this is the matrix we want to import.
• Enter: no constraint matrix is specified.
• n: no aggregation for origins.
• n: no aggregation for destinations.
• n: no submatrix is specified.
• 5: end.

This produces a file named mfnn.txt, to be found in the same folder as the Emmebank.

### Traffic State import: VOL files ¶

In Emme, execute the following commands:

• Preparing the scenario:
• 5.11: Prepare scenario for assignment.
• 1: fixed demand auto assignment.
• 1: single class assignment on auto mode.
• mfnn: the matrix to be assigned.
• Enter: default value.
• Enter: default value.
• Enter: default value.
• Enter: default value.
• Enter: default value.
• Enter: default value.
• Doing an auto assignment:
• 5.21: Auto assignment.
• 1: Terminal.
• 6.11: List auto times and volumes.
• 1: auto plus additional volumes.
• *: Selected link types or attributes (from, to).
• 2: Printer.

A file named ‘reports’ is created in the Emmebank folder with the information related to the links.Save this data by renaming the file to ‘links.vol’ . Note that if the file ‘reports’ already exists, it should be renamed or deleted before executing these commands as the process appends data to the reports file and existing unwanted report information will be included in the file.

• Extracting the file ‘turnings.vol’
• 6.11: List auto times and volumes.
• 2: on intersections.
• 2: in-line.
• 1: auto plus additional volumes.
• *: Selected node numbers or attributes (from, to).
• 2: Printer.

After this, the file named ‘reports’ is again created in the Emmebank folder, this time containing the information about turns. Rename the ‘reports’ file to ‘turnings.vol’.

### Emme PTLines: ptlines.out ¶

In Emme, execute the following commands:

• Fixing the name of the file that will contain the PTLines data:
• batchout=ptlines.out
• Punching the data:
• 2.24: Output transit lines.
• 4: punch transit lines.
• *: Enter: Selected transit lines or attributes: we select all of them.
• 6: end.

After this, the file named ptlines.out is available with all the required information to import PTLines to Aimsun Next. This file is to be found in the same folder as the Emmebank.

### Generation of additional nodes for the use of entrance/exit flows as additional counts¶

This is an additional function used to in a model translation for a special case of OD matrix adjustment in which, in addition to link flow counts on a subset of links, estimates of the total traffic volumes attracted and/or generated by a subset or all the zones in the model, are available. When exporting the geometry, the option Generate structure to use OD totals as counts will cause a change to the topology of the centroids and connections of the Emme network to allow the total traffic volumes attracted and/or generated in the later matrix adjustment process to be included in the Emme model.

Assuming a centroid connected by several input and output connections to the network in the Aimsun model, as depicted in figure above, in the regular translation to Emme shown in figure below on the left, nodes i, j, and k are the new nodes connected to the centroid n. But if the Generate structure to use OD totals as counts option is checked, then the connections topology is changed as shown in below on the right:

A new node m is created and links entering or exiting node m play then the role of equivalent connections, although actual connections are n to m and m to n in the Emme model.

No traffic flow can use the links entering or exiting node m, except for flows that reach or come from centroid n. According to this purpose, turn movements originating and ending at the equivalent connections must be banned. That is, for example, turn k to m to j will be banned, while n to m to j will be allowed.