Skip to content

Aimsun Next Hybrid Meso-Micro Simulator Scripts

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

The hybrid meso-micro simulator features are only available in the Aimsun Expert and Aimsun Advanced Editions.

Simulating a Replication

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

  1. Get the hybrid 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 hybrid 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 database

To retrieve hybrid simulation results from database:

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

Retrieving simulation paths from an APA file

To retrieve hybrid simulation path results from an APA file:

  1. Get the hybrid 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 hybrid meso-micro replication:

  1. Get the origin hybrid 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 )

```