New version page

SIMULATION 101 SOFTWARE: WORKSHOP AND BEYOND

Upgrade to remove ads

This preview shows page 1 out of 4 pages.

Save
View Full Document
Premium Document
Do you want full access? Go Premium and unlock all 4 pages.
Access to all documents
Download any document
Ad free experience

Upgrade to remove ads
Unformatted text preview:

INTRODUCTIONSOFTWARE INSTALLATION AND EXECUTIONObtaining the SoftwareCompiling and ExecutingSOFTWARE OVERVIEWLibrariesMonte Carlo SimulationsDiscrete-Event SimulationsUtilitiesSUMMARYProceedings of the 2007 Winter Simulation ConferenceS. G. Henderson, B. Biller, M.-H. Hsieh, J. Shortle, J. D. Tew, and R. R. Barton, eds.SIMULATION 101 SOFTWARE: WORKSHOP AND BEYONDBarry LawsonDepartment of Mathematics and Computer ScienceUniversity of RichmondRichmond, VA 23173-0001, U.S.A.Lawrence LeemisDepartment of MathematicsCollege of William & MaryWilliamsburg, VA 23187-8795, U.S.A.ABSTRACTThe C source code associated with the Simulation 101 pre-conference workshop (offered at the 2006 and 2007 WinterSimulation Conferences) is presented here. This paper be-gins with general instructions for downloading, compiling,and executing the software. This is followed by sections onfour groups of the software, categorized by functionality:libraries, Monte Carlo simulations, discrete-event simula-tions, and utilities. The libraries contain code to generaterandom numbers, code to generate random variates, andcode to evaluate probability density functions, cumulativedistribution functions, and inverse distribution functions.The Monte Carlo simulations consist of six programs thatestimate various probabilities associated with simple prob-ability problems, some with known analytic solutions andothers without analytic solutions. The discrete-event sim-ulations consist of various applications from queueing andinventory systems. Finally, the utilities are used to calculatevarious point and interval estimators from data sets.1 INTRODUCTIONThis paper discusses the use of the simulation softwareprovided with the Simulation 101 workshop and associatedwith the introductory simulation textbook by Leemis andPark (2006).2 SOFTWARE INSTALLATION AND EXECUTIONThis section describes where to obtain and how to compileand execute the simulation software. Note that more specificsabout execution of individual programs will be discussedon a program-by-program basis in Section 3.2.1 Obtaining the SoftwareThe software is freely available via hhttp://math.wm.edu/∼leemis/Sim101 SourceCode.zipi as aWindows-friendly zip file or via hhttp://math.wm.edu/∼leemis/Sim101 SourceCode.tgzi as aGNU-zip tarfile. Download the file corresponding to thearchive type of your choice.To extract the contents of the zip version, use any stan-dard zip utility (e.g., WinZip for Windows, Stuffit Expanderfor Mac OS X, zip for Unix/Linux). To extract the contentsof the GNU-zip tar file, execute the following command:tar -xzvf Sim101_SourceCode.tgzThe source code will be placed into a subdirectory namedSim101 SourceCode/ within the directory from whichyou initiate the extraction process.2.2 Compiling and ExecutingThe software is ANSI C compliant, and so may be compiledby any compiler or development environment that supportsANSI C compilation.We recommend using the GNU gcc compiler, whichin the Makefile provided with the software is assumed tobe the default compiler. If you use gcc and the associatedmake utility, following are commands of interest.• make: Compiles and links all software, creatingany of the executables that do not exist and executa-bles for any of the source files that were modifiedsince the last compile. The make utility createsexecutable files having the same names as the asso-ciated source files (e.g., the source file galileo.cresults in the executable file galileo).• make clean: Removes all executable and objectfiles.• make programName: Compiles and links onlythose files necessary for programName.If you are not using make, then you will need toconfigure your compiler to appropriately link and compilethe necessary software. When compiling any of the providedLawson and Leemissource files that include local versions of header (.h) file(s),you will need to include the corresponding .c file(s) inthe compilation and linking process. For example, ssq4.cincludes both rngs.h and rvgs.h and so the compilationand linking process must include rngs.c and rvgs.c:gcc -o ssq4 ssq4.c rngs.c rvgs.c -lmWhen compiling any source file (e.g., ssq4.c) that includesthe math library header file math.h, you may need toexplicitly signify to the compiler to include the math libraryin the linking process, typically with a -lm flag (see theexample above).To execute any of the programs, simply provide thename of the executable as a command, e.g., ./ssq4. (Notethat certain of the source files are to be used as librariesand not to directly create an executable—see Section 3.1.)3 SOFTWARE OVERVIEWThe Simulation 101 software is easily categorized into fourbasic groups: libraries, Monte Carlo simulations, discrete-event simulations, and utilities. We also provide an overviewof the capabilities and uses of each of the programs. Theprograms are listed in alphabetical order within each of thegroups.3.1 LibrariesThe programs in this group are to be used as libraries forother simulation programs (e.g., the Monte Carlo or discrete-event simulation programs in the next two subsections, orany simulation program you may create from scratch). Thelibraries provide a multiple-stream Lehmer random numbergenerator (rngs), a collection of functions to generaterandom variates from various distributions (rvgs), andutility functions associated with each of the distributions(rvms). These are described in more detail below.rngs: This library implements the functions for agood Lehmer random number generator with capability formultiple (255 by default) streams of random numbers, oneper stochastic component of a simulation program. Theprimary functions of interest provided by this library are asfollows:• double Random(): returns a pseudo-randomnumber uniformly distributed between 0.0 and 1.0.The period of the generator is (m − 1) distinctrandom numbers, where m = 231−1. The smallestand largest possible values are 1/m and and (m −1)/m respectively. More details are provided inPark and Miller (1988).• void PlantSeeds(long x): initializes thestate of each of the streams. Typically, this func-tion is called once, at the beginning of the simu-lation program prior to any calls to Random().The value x is used to initialize the state of thedefault stream, and then all remaining streams areinitialized appropriately. If x is positive, x is thestate; if x is negative, the state is obtained using thesystem clock; if x is 0, the state is to be suppliedinteractively.• void


Download SIMULATION 101 SOFTWARE: WORKSHOP AND BEYOND
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view SIMULATION 101 SOFTWARE: WORKSHOP AND BEYOND and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view SIMULATION 101 SOFTWARE: WORKSHOP AND BEYOND 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?