This project produces a dll (MengeCS.dll) which can be included in C-Sharp projects to provide access to the Menge simulation core. This is a very simple wrapper of the Menge C-API. The features in this library will grow as the C-API grows, exposing more Menge features to C#. As it is, this is sufficient to initialize the Menge simulator, step through simulation, and query minimum agent state.
The project depends on the MengeCore.dll. You'll want to modify the build settings to match your local build of Menge. Do the following:
- Open the file
$MengeCS$\MengeCS\MengeCS.csproj
in a text editor. - Line 5 defines the property:
MengeDir
. Change the path shown there to match the path to the Menge library build on your system.
This will allow the project to automatically pull over the most recent version of the MengeCore.dll into your project. This is particularly important because we don't want include the MengeCore.dll in this repository.
This includes a Visual Studio 2013 solution with two projects:
MengeCS
- an interop-services based wrapper for the Menge C-APIMengeCSExe
- a simple command-line program illustrating simple execution of theMengeCS
library.
The MengeCS
project doesn't care whether the MengeCore.dll
is built in 32- or 64-bit mode.
However, the executable does care. In creating your own exectuable, make sure the "Platform
target" is set appropriately for the build of MengeCore.dll
: x86
for 32-bit and x64
for
64-bit. Otherwise, there will be an error loading the dll.