CIS 22 - Simulations: Simulation
Examples
Following are the three simulations I coded to help you better understand simulation programming. Basically, each link hyperlinks to a ".zip" file, which you should unzip to it's own folder. Included in each is a Makefile, which will make compiling the programs a simple process. All you have to do is type "make" at a unix command prompt, and everything should compile. In each folder should be a few input files that start with the word "in" (ie. in1.txt, in9.txt). You should take a look at the code, and see how the input files are structured, and how the program reads in the data. When you execute each program, you'll be asked for the input and output file names. After that, just let the simulation do it's thing. When it's done, you can view the output file, and what it "says" to you regarding optimal situations. These compiled in Unix perfectly, and you shouldn't have any problems getting these to work.
Click to download source & input files for Registration Simulation (Reg. Queue)
Click to download source & input files for Registration Simulation (Priority Queue)
Click to download source & input files for Supermarket Simulation
Back to CIS 22 home page