Skip to content

Aimsun Next Mesoscopic Simulator Scripts

The Aimsun Next Meso Plug-in offers services to simulate mesoscopic replications, to calculate the average of several replications, to retrieve from a database simulation results or averages and to calculate a dynamic traversal.

The mesoscopic simulator features are only available in the Aimsun Next Pro Meso, Advanced, and Expert Editions.

Simulating a Replication

To simulate an existing replication, either from a DTA experiment, DUE experiment or incremental DUE experiment:

  1. Get the meso replication (in this example, using its identifier).
  2. Call the "execute" kernel action.
replication = model.getCatalog().find( 1001 )
GKSystem.getSystem().executeAction( "execute", replication, [], "" )

To run a set of simulations in sequence, you just have to provide a list of replications as third argument. Note that you need to state one of the replications as the second argument even though only the ones in the list (third argument), if it is not empty, will be simulated. The second argument needs to be an object of the same type as the ones in the third argument.

replication1 = model.getCatalog().find( 1001 )
replication2 = model.getCatalog().find( 1002 )
GKSystem.getSystem().executeAction( "execute", replication1, [replication1, replication2], "" )

Calculating an Average

To calculate the average of several mesoscopic replications:

  1. Get the average (in this example, using its identifier).
  2. Call the "execute" kernel action.
average = model.getCatalog().find( 1002 )
GKSystem.getSystem().executeAction( "execute", average, [], "" )

Retrieving simulation results from the database

To retrieve mesoscopic simulation results from the database:

  1. Get the meso replication (in this example, using its identifier).
  2. Call the "retrieve" kernel action.
replication = model.getCatalog().find( 1001 )
GKSystem.getSystem().executeAction( "retrieve", replication, [], "" )

Retrieving path results from an APA file

To retrieve mesoscopic simulation path results from an APA file:

  1. Get the meso replication (in this example, using its identifier).
  2. Call the "retrieve_paths" kernel action.
replication = model.getCatalog().find( 1001 )
GKSystem.getSystem().executeAction( "retrieve_paths", replication, [], "" )

Example: Dynamic traversal calculation

To perform a dynamic traversal calculation from a mesoscopic replication:

  1. Get the origin mesoscopic replication (in this example, using its identifier).
  2. Get the subnetwork from which the traversal will be created (in this example, using its identifier).
  3. Configure the traversal calculation parameters.
  4. Call the "generate_traversal" kernel action.

as shown in the example below:

```` replication = model.getCatalog().find( 720 ) subNet = model.getCatalog().find( 675 )

replication.setTraversalSubnet( subNet )
replication.setTraversalRoutes( True )
GKSystem::getSystem().executeAction( "generate_traversal", replication, [], "" )
replication.setTraversalSubnet( None )

```