Alternative Trace-Driven Simulation

The trace-driven simulation approach presented here is based on the original model provided by Professor Kemper but is simplified for the sake of comprehension and (hopefully) speed of execution. The project uses an external C++ library to load the trace data from a binary file, which means that, given a trace consisting of floating point values encoded as character strings, the values must be packed contiguously into a binary file before they can be used by the project. I have included a sample Python script that performs such a transformation, packing the values into their binary representation according to the native byte order, size, and alignment of the machine on which it is executed:

The script expects a single command-line argument indicating the path to your newline-delimited, character-encoded trace data. The binary encoding of your data is dumped to standard out, so it will need to be redirected to a file using standard command-line I/O redirection.

A link to the trace-driven simulation project is provided below:

The source code for the external library is included in the Trace subdirectory of the main project directory. The library will need to be built outside of Möbius, as Möbius provides no facility for compiling custom libraries. A Makefile is not provided, though the library can be built easily by executing the following commands in the source directory:

g++ -c trace.cpp
ar cq libtrace.a *.o

The library contains only two functions, initIATs() and nextIAT(). The initIATs() function is called by the Custom Initialization section of the TDAP atomic model. It takes a single argument, indicating the path to your binary-encoded trace data, which will likely need to be modified for your purposes. The nextIAT() function returns the next interarrival time from your trace as in an iterator pattern, though when it reaches the end of your trace, it restarts again from the beginning. The nextIAT() function is called to provide a value for the Deterministic distribution which governs the firing of the IATs activity in the TDAP atomic model.

The steady-state simulation solver TraceSimulation executes a series experiments to calculate statistics like average utilization, average queue length, and the probability that the queue length will exceed a certain threshold for a range of values specified by the study TraceStudy.