Alan Kaminsky Department of Computer Science Rochester Institute of Technology 4572 + 2433 = 7005
Home Page

Simulation Simplified

Prof. Alan Kaminsky
Rochester Institute of Technology -- Department of Computer Science

Table of Contents
Preface
Licenses
Downloads
Source Code Listings


Table Of Contents

    Preface

  1. A Dice Game
  2. Bernoulli Distribution
  3. Gathering and Displaying Data
  4. Chi-Square Test
  5. A Distributed Encyclopedia
  6. Graphs
  7. Random Subsets and Permutations
  8. Breadth-First Search
  9. Mean, Median, and the Like
  10. Knob Turning
  11. Regression
  1. Multiple Knob Turning
  2. Discrete Event Simulation
  3. Exponential Distribution
  4. Priority Queues
  5. A Web Server
  6. A DOS Attack
  7. Uniform Distribution
  8. A Distributed Encyclopedia, Part 2
  9. Encyclopedia: Scalable?

  1. Source Code Listings
  2. Further Reading


Preface

While teaching various courses, including Data Communications and Networks, Ad Hoc Networks, and Distributed Systems, I have found myself wanting to explore questions such as these with the class:

There are three ways to answer such questions:

There exist general-purpose simulation languages, as well as specialized simulation packages in various domains, such as network simulation. However, I've usually found these languages and packages to be large, complex, and feature-laden, such that writing even a simple little simulation requires climbing a steep learning curve. At the same time, I've usually found these languages and packages to lack features I want, and it's either difficult (because the language's or package's source code is unreadable) or impossible (because the language or package is proprietary) to add features.

All is not lost! I have found that with the ability to write high level language code plus a modicum of background in probability and statistics, one can develop a broad range of useful simulation programs. However, the techniques for writing simulation programs are not usually taught in computer science curricula. Through a series of examples in Chapters 1-20, this book teaches the art of simulation programming. This book is intended to be used as a supplement in a course that uses simulation as an investigatory tool.

The Java programming language is used for the examples in this book. However, those with experience in other high level languages should have no difficulty following the discussion and adapting the programs to their preferred language. The example program source files are free, GNU GPL licensed software and may be downloaded from my web site (http://www.cs.rit.edu/~ark/ss/). Source file listings appear in Appendix A.

This book also makes use of Java classes from my Parallel Java 2 Library. The Parallel Java 2 Library is free, GNU GPL licensed software and may be downloaded from my web site (http://www.cs.rit.edu/~ark/pj2.shtml). The download includes complete source code and Javadoc documentation. While the Parallel Java 2 Library is mainly intended for writing parallel programs in Java, it contains many classes useful for non-parallel programs as well. (I may discuss parallel simulation programming in a later edition of this book.)

For those desiring further information about various topics mentioned in this book, I recommend the sources listed in Appendix B, "Further Reading."

Alan Kaminsky
February 2014


Licenses

The book Simulation Simplified is copyright © 2014 by Alan Kaminsky.

The book Simulation Simplified is licensed under the Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/3.0/ or send a letter to Creative Commons, 444 Castro Street, Suite 900, Mountain View, California, 94041, USA.

The program source files described in this book and listed in Appendix A ("The Programs") are copyright © 2014 by Alan Kaminsky.

The Programs are free software: you can redistribute them and/or modify them under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

The Programs are distributed in the hope that they will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with The Programs. If not, see http://www.gnu.org/licenses/.


Downloads

The book Simulation Simplified, version 04-Feb-2014 (1,486,110 bytes): ss20140204.pdf
Please consider the environment before printing this book!

Java archive with example programs, version 04-Feb-2014 (31,377 bytes): ss20140204.jar


Source Code Listings

1. A Dice Game
— Class Dice01
— Class Dice02

2. Bernoulli Distribution
— Class Dice03
— Class edu.rit.numeric.BernoulliPrng
— Class Dice04

3. Gathering and Displaying Data
— Class Dice05
— Class Dice06

4. Chi-Square Test
— Class Dice07

6. Graphs
— Class P2Pedia01

7. Random Subsets and Permutations
— Class edu.rit.util.RandomSubset
— Class P2Pedia01

8. Breadth-First Search
— Class P2Pedia01

9. Mean, Median, and the Like
— Class P2Pedia02
— Class P2Pedia03
— Class P2Pedia03a

10. Knob Turning
— Class P2Pedia04

11. Regression
— Class P2Pedia05

12. Multiple Knob Turning
— Class P2Pedia06

14. Exponential Distribution
— Class edu.rit.numeric.DoublePrng
— Class edu.rit.numeric.ExponentialPrng

15. Priority Queues
— Class edu.rit.sim.Event
— Class edu.rit.sim.Simulation

16. A Web Server
— Class WebServer01

17. A DOS Attack
— Class WebServer02

18. Uniform Distribution
— Class edu.rit.numeric.UniformPrng

19. A Distributed Encyclopedia, Part 2
— Class P2Pedia07

20. Encyclopedia: Scalable?
— Class P2Pedia08

Alan Kaminsky Department of Computer Science Rochester Institute of Technology 4572 + 2433 = 7005
Home Page
Copyright © 2014 by Alan Kaminsky. All rights reserved. Last updated 04-Feb-2014. Send comments to ark­@­cs.rit.edu.