Office of Operations
21st Century Operations Using 21st Century Technologies

Appendix L: Run-Time Extension Overview

TSIS provides a mechanism by which an external application can interface directly with the CORSIM simulation tool.  This type of application has become known as a CORSIM run-time extension (RTE).  The original RTEs were tailored for signal timing studies.  However, the concept has been expanded to support freeway monitoring, incident detection, and ramp metering.

The RTE capability enables CORSIM to operate with actual hardware in the loop.  Some examples of these hardware-in-the-loop experiments include using 170, NEMA, and 2070 controllers to control the signal states at certain intersections in the simulation.  In these experiments, the controller is interfaced to the simulation using a Controller Interface Device (CID) that connects to the serial interface of the computer that hosts the simulation.  Another experiment involved using an advanced camera sensor and image processing software to estimate the queue state of simulated vehicles as they approach an intersection.  The queue states for the approaches to the intersection are used by an adaptive control algorithm to make intelligent decisions about what the optimal signal state should be.  RTEs can also be used to test adaptive signal control algorithms for effectiveness before they are implemented in the field.  With the rapid evolution of technology, these types of experiments are necessary, not only to assess the benefits of advanced ITS applications, but to verify their operational capability before field deployment.

The Run-Time Extension interface

Figure 113 illustrates the operation of CORSIM within the TSIS 6.0 architecture including the interfaces that support the operation of RTEs.  In the figure, the block arrows represent Component Object Model (COM) interfaces and the thin arrows represent standard dynamic-link library (DLL) interfaces.  In this model, the CORSIM Driver Component is the TSIS tool that runs the CORSIM simulation and interfaces to the TShell user interface.  This component enables the user to control CORSIM execution and output processing, and manages all user-supplied RTE.  Although the entire CORSIM architecture is shown for completeness, the RTE interfaces are marked 1, 2, 3, and 4 in the diagram.

 

This figure shows the TSIS architecture for purposes of explaining a run time extension.  CORSIM DLL with its exported functions and exported memory are just one small part of the architecture.  TSIS provides the CORWin interface for CORSIM and the RTE to send messages back to TSIS.  The CORSIM Server runs CORSIM and notifies the TSD interface when data is ready to be written to the files.  The CORSIM Driver is the user interface between the CORSIM Server and TShell.

Figure 113. Diagram. TSIS architecture.

For each simulation time step, the CORSIM Server calls a series of functions within CORSIM to drive the simulation event loop.  When an RTE is present and enabled, the CORSIM Server also calls the exported functions of the RTE based on messages it receives from CORSIM at different points in the CORSIM execution timeline.  The server also calls the RTE's initialization function during CORSIM initialization and the RTE's exit function at the end of the simulation.  This interface is illustrated in the figure by the path marked "1".  Although not illustrated in the figure, the architecture supports multiple RTEs.

TSIS also provides an interface (CORWin) that enables an RTE to send messages to the CORSIM Server and to send text messages to be displayed by the CORSIM Driver.  This interface is illustrated in the figure by the path marked "2".

Additionally, the RTE can directly access many of the data structures in CORSIM because they have been exported as shared memory.  The shared memory not only allows the RTE to extract information from the simulation but also enables the RTE to control different aspects of the simulation.  The shared memory interface is illustrated in the figure by the path marked "3".

As this architecture evolves, the CORSIM shared memory interface is being replaced by Application Program Interfaces (APIs).  Use of APIs rather than the shared-memory mechanism reduces the coupling between a user’s RTE and the underlying CORSIM data structures.  With APIs, CORSIM developers can modify those data structures to maintain and enhance CORSIM without causing users to re-write their RTEs.

Finally, the RTE may directly call exported CORSIM functions via the control API (e.g., to abort the simulation) and the actuated control API.  These interfaces are illustrated in the figure by the path marked "4".

Building a CORSIM RTE requires a suitable compiler such as Microsoft Visual C++ or FORTRAN and the TSIS package, which includes all of the components shown in the previous figure (except for the RTE).  Compilers supplied by vendors other than Microsoft can be used but the developer will have to refer to the compiler-specific documentation for information regarding linking with Microsoft-compiled libraries. 

The TSIS RTE Toolkit contains valuable tools to assist an analyst in understanding how to create their own RTEs.  The RTE Toolkit contains a RTE Developers Guide, CORSIM Data Dictionary, a debug version of the CORSIM Driver, and a sample RTE.  This Toolkit can be obtained from the TSIS distributor where the TSIS package was purchased; however, at this time the Toolkit and RTE functionality are not part of the standard TSIS package.

Office of Operations