Skip to content

Aimsun Next MicroSDK Starter's Guide

Windows version

Installation

The microSDK files are located in the Aimsun Next installation folder, /ProgramFiles/Aimsun/Aimsun Next X.X/programming/Aimsun Next microSDK subfolder.

First, copy the entire Aimsun Next microSDK directory from the system files into a new document folder with read and write permissions.

The Aimsun Next microSDK folder contains 4 subfolders:

  • ext
  • include
  • lib
  • samples

The ext, include, and lib folders contain libraries and declaration files that will be used to build the DLL (DYLIB for mac) files and MUST NOT be modified. The samples folder contains five examples of microSDK projects.

To open a project, Visual Studio 2019 must be installed. Double click on the microSDKsample.sln file of any of the examples. The content of the project can be viewed by clicking on the cross left to microSDKsample.



Editing

The Header and Source Files can be displayed by double-clicking on them.



Compilation

To build the DLL file, click on Build : Rebuild microSDKsample.



The output of the compilation appears in the bottom window. Check for errors and warnings!

There are options to to build a Debug or Release DLL. The Debug DLL should be used for the development of the project as it allows to use the debugger and follows each step of the execution. The Release DLL will be executed faster and should be used during the operational phase.

Changing the name of the DLL



The output file name can be changed in the microSDKsample Properties folder accessed from a right click on the cross left of microSDKsample.

Modifying the XML file

The XML file can be edited with any text editor such as Notepad for example Only modify the second line according to the name of the DLL file to be used:



Mac version

Installation

The microSDK files are located in the Aimsun Next installation package (DMG), in the programming/Aimsun Next microSDK subfolder.

First, copy the entire programming folder to your Application folder, where you have previously installed the Aimsun Next app.

The Aimsun Next microSDK folder contains 4 subfolders:

  • ext
  • include
  • lib
  • samples

The ext, include and lib folders contain libraries and declaration files that will be used to build the DYLIB files and MUST NOT be modified. The samples folder contains five examples of microSDK projects.

Compilation

To build the DYLIB file, open a terminal, go to the folder where the header and source code files are, generate the makefiles (qmake .pro), and then compile and build the libraries (make).

The output of the compilation will appear in the terminal. Check for errors and warnings. If everything is successful the dylib will be ready to be loaded in Aimsun Next

Examples

Five microSDK examples have been supplied which cover the basic behavioral model implementations possibilities currently available in the Aimsun Next microSDK:

01_CarFollowingModel: Computes the new value for the speed and position of all vehicles using the Gipps Car Following Model. All remaining parts of the model are controlled by the default model.

02_CarFollowingAccelerationModel: Only modifies the acceleration component of the Car Following Model . Any function returning a positive (or null) speed can be implemented. All remaining parts of the model are controlled by the default model.

03_LaneChangingModel: Uses the valid lanes defined by the lookahead model to determine whether a lane changing is necessary, looks for adjacent gap and either performs a lane changing if the gap is acceptable or adapts to it. All remaining parts of the model are controlled by the default model.

04_GiveWayModel: Uses the yield information for each vehicle to decide whether to yield or not.

05_FullModel: This example uses all the above algorithms.

Testing the different examples

Windows version

To test the different examples, follow the steps detailed below:

  • Build the Debug DLL and copy both the XML and the DLL file into the following directory: "Program Files/Aimsun/Aimsun Next X.X/plugins/aimsun/models"
  • Launch Aimsun Next and open the Network: microSDKtestNetwork.ang which is found in the samples directory.
  • Open the microSDKsample project and put a breakpoint in one of the functions of the file behavioralModelParticular.cxx.
  • Attach it to the process using: Debug : Attach to Process and select the "Aimsun Next.exe" process.
  • Run the simulation and follow what the DLL is computing.



Mac version

To test the different examples, follow the steps detailed below:

  • Go to the samples folder and build the Makefile for the allSample.pro
  • Compile and build them. the *DYLIB will be automatically generated inside Aimsun Next.app/Contents/PlugIns/aimsun/models.
  • Copy the XML of the sample you want to try into that same folder (Aimsun Next.app/Contents/PlugIns/aimsun/models)
  • Launch Aimsun Next and open the Network: microSDKtestNetwork.ang which is found in the samples directory.
  • Run the microscopic simulation and you will see that the model for which you have copied the XML for is executed through the simulation.