VBASim Source Code

VBASim is a collection of VBA Subs, Functions and Class Modules to support discrete-event simulation in VBA and Excel. VBASim is used in the text Foundations and Methods of Stochastic Simulation: A First Course, Springer.

Download the TTF Simulation (Chapter 2).
Download the VBASim software.
Download the VBASim examples.
Download the VBASim Fax Center example.

Python 2.7 Version (beta)

VBASim and some examples have been translated (thanks to Yujing Lin) into Python 2.7, which we are calling VBASim.Python. This is a beta release that has only been lightly tested. A stable release is expected by Summer 2018.

As far as possible, we have translated VBASim and the examples into Python 2.7 so that they match VBASim and the VBA examples in Foundations, rather trying to exploit features of Python. Because Python handles global variables so differently from VBA we pass variables such as Clock that VBASim treats as global.

Download the Python 2.7 software and examples.

Java Version

VBASim and the examples have been translated (thanks to Luis De La Torre) into Java, along with Chapter 4 of the Foundations book to support its use. We have attempted to use standard Java conventions, but you should probably expect to have to tweak the code for your particular installation. While the code has been tested, it has not been used extensively.

As far as possible, we have translated VBASim and the examples into Java so that they match VBASim and the VBA examples in Foundations, rather trying to exploit features of Java. This is to facilitate teaching a class with students using different programming languages.

Download the README file.
Download the Java software and examples.
Download the Java version of Chapter 4.

Matlab Version

VBASim and the examples have been translated (thanks to Weitao Duan) into Matlab, along with Chapter 4 of the Foundations book to support its use. We have attempted to use standard Matlab conventions, but you should probably expect to have to tweak the code for your particular installation. While the code has been tested, it has not been used extensively.

As far as possible, we have translated VBASim and the examples into Matlab so that they match VBASim and the VBA examples in Foundations, rather trying to exploit features of Matlab. This is to facilitate teaching a class with students using different programming languages. For Matlab, this leads to particularly slow execution, especially for random-number generation. Therefore, our default installation uses the native Matlab random-number generator rather than the one in VBASim. To use the same generator as in VBASim, see the file lcgrand.m.

Download the README file.
Download the Matlab software and examples.
Download the Matlab version of Chapter 4.

Python Version

The examples have been translated (thanks to Prof. Louis Luangkesorn at University of Pittsburgh) into Python, along with Chapter 4 of the Foundations book to support its use. The code requires SimPy, a free object-oriented, process-based discrete-event simulation library for Python found at simpy.sourceforge.net/old/.

Download the Python examples.
Download the Python version of Chapter 4.