Simulation Modeling using the Kotlin Simulation Library (KSL)
Preface
Release History
KSL Project Page
Book Support Files
Acknowledgments
Intended Audience
Organization of the Book
About the Author
1
Simulation Modeling
1.1
Simulation Modeling
1.2
Why Simulate?
1.3
Types of Systems and Simulation Models
1.4
Simulation: Descriptive or Prescriptive Modeling?
1.5
Randomness in Simulation
1.6
Simulation Languages
1.7
Simulation Methodology
1.8
Overview of the Kotlin Simulation Library
1.9
Exercises
2
Modeling Randomness
2.1
Random Number Generator
2.1.1
Random Package
2.1.2
Creating and Using Streams
2.1.3
Common Random Numbers
2.1.4
Creating and Using Antithetic Streams
2.1.5
Frequently Asked Questions about Random Numbers
2.2
Random Variate Generation
2.2.1
Basic Random Variate Generation
2.2.2
Continuous and Discrete Random Variables
2.2.3
Creating and Using Random Variables
2.2.4
Functions of Random Variables
2.3
Probability Distribution Models
2.4
Distribution Fitting Using the KSL
2.4.1
Estimating Distribution Parameters
2.4.2
Continuous Distribution Recommendation Framework
2.4.3
Discrete Distribution Framework
2.4.4
Illustrative Examples from Appendix @ref(appidm)
2.5
Summary
2.6
Exercises
3
Monte Carlo Methods
3.1
Collecting Statistics
3.1.1
Creating and Using a Statistic
3.1.2
Histograms and Frequencies
3.1.3
Batch Statistics
3.1.4
Statistics Summary
3.2
Simple Monte Carlo Integration
3.3
Review of Statistical Concepts
3.3.1
Point Estimates and Confidence Intervals
3.3.2
Sample Size Determination
3.3.3
Determining the Sample Size for a Monte Carlo Simulation Experiment
3.4
Simulating the Game of Craps
3.5
The News Vendor Problem
3.6
A Simple Inspection Process
3.7
Stochastic Activity Networks
3.8
Monte-Carlo Experiments
3.9
Summary
3.10
Exercises
4
Introduction to Discrete Event Modeling
4.1
Discrete-Event Dynamic Systems
4.2
How the Discrete-Event Clock Works
4.3
Simulating a Queueing System By Hand
4.4
Modeling DEDS in the KSL
4.4.1
Event Scheduling
4.4.2
Simple Event Scheduling Examples
4.4.3
Up and Down Component Example
4.4.4
Modeling a Simple Queueing System
4.4.5
More Details About the Pharmacy Model Implementation
4.5
Enhancing the Drive Through Pharmacy Model
4.6
More Drive Through Fun
4.6.1
Modeling a Simple Resource
4.6.2
Modeling a Resource with a Waiting Line
4.6.3
Modeling the Tandem Queue of Example @ref(exm:exCh4TandemQ)
4.6.4
Modeling with the Station Package
4.7
Summary
4.8
Exercises
5
Analyzing and Accessing Simulation Output
5.1
Types of Statistical Variables
5.2
Types of Simulation With Respect To Output Analysis
5.3
Analysis of Finite Horizon Simulations
5.4
Capturing Output for a Simple Finite Horizon Simulation
5.4.1
KSL Functionality for Capturing Statistical Results
5.4.2
Additional Remarks
5.4.3
Querying the KSL Database
5.5
Sequential Sampling for Finite Horizon Simulations
5.6
Analysis of Infinite Horizon Simulations
5.6.1
Assessing the Effect of Initial Conditions
5.6.2
Performing the Method of Replication-Deletion
5.6.3
The Method of Batch Means
5.6.4
Performing the Method of Batch Means
5.7
Comparing System Configurations
5.7.1
Comparing Two Systems
5.7.2
Concepts for Comparing Systems
5.7.3
Multiple Comparison with the Best Procedures (MCB)
5.7.4
Screening Procedures
5.8
Simulating Many Scenarios
5.8.1
Control Annotations
5.8.2
Random Variable Parameters
5.8.3
Setting Up and Running Multiple Scenarios
5.9
Summary
5.10
Exercises
6
Process View Modeling Using the KSL
6.1
What are Entities?
6.2
The Process View
6.3
Understanding KSL Processes and Entities
6.4
Examples of Process Modeling
6.4.1
Holding Entities in a Queue:
HoldQueue
Class
6.4.2
Signaling Entities
6.4.3
Understanding Blocking Queues
6.4.4
Allowing Entities to Wait for a Process
6.4.5
Process Interaction
6.5
Modeling a STEM Career Mixer
6.5.1
Conceptualizing the System
6.5.2
Implementing the STEM Mixer Model
6.6
The Tie-Dye T-Shirt Model
6.6.1
Implementing the Tie-Dye T-Shirt Model
6.7
Summary
6.8
Exercises
7
Advanced Event and Process View Modeling
7.1
Modeling with Processes and Resources
7.1.1
Modeling Space with Resources
7.1.2
Resource Pools
7.1.3
Computer Test and Repair Shop Example
7.2
Modeling Non-Stationary Systems
7.2.1
Non-Stationary Arrival Processes
7.2.2
Modeling Resources Under Non-Stationary Conditions
7.2.3
Enhancing the STEM Career Mixer Model
7.3
Examples of Advanced Event Models
7.3.1
Modeling Balking and Reneging
7.3.2
Modeling a Reorder Point, Reorder Quantity Inventory Policy
7.4
Applying Queueing Theory Results to Verify and Validate a Simulation
7.4.1
Analyzing the Preparation Station
7.4.2
Analyzing the Build Lines
7.4.3
Analyzing the Packaging Station
7.4.4
Analyzing the Palletizing Station
7.4.5
Analyzing the Total System Time
7.4.6
Other Issues for Verification and Validation
7.5
Summary
7.6
Exercises
8
Advanced Monte Carlo Methods
8.1
Bootstrap Methods
8.1.1
Bootstrapping Using the KSL
8.2
Variance Reduction Techniques
8.2.1
Common Random Numbers (CRN)
8.2.2
Antithetic Variates (AV)
8.2.3
Indirect Estimation
8.2.4
Control Variates (CV)
8.2.5
Stratified and Post Stratified Sampling
8.2.6
Conditional Expectation (CE)
8.2.7
Importance Sampling (IS)
8.3
Generating Multi-Variate and Correlated Random Variates
8.3.1
Generating from a Bivariate Normal Distribution
8.3.2
Copulas and Multi-variate Generation Methods
8.3.3
Autocorrelated Generation
8.3.4
Introduction to Markov Chain Monte Carlo Methods
8.4
Summary
8.5
Exercises
Appendix
A
Generating Pseudo-Random Numbers and Random Variates
A.1
Pseudo Random Numbers
A.1.1
Random Number Generators
A.2
Generating Random Variates from Distributions
A.2.1
Inverse Transform Method
A.2.2
Convolution
A.2.3
Acceptance/Rejection
A.2.4
Mixture Distributions, Truncated Distributions, and Shifted Random Variables
A.3
Summary
A.4
Exercises
B
Probability Distribution Modeling
B.1
Random Variables and Probability Distributions
B.2
Modeling with Discrete Distributions
B.3
Fitting Discrete Distributions
B.3.1
Fitting a Poisson Distribution
B.3.2
Visualizing the Data
B.3.3
Estimating the Rate Parameter for the Poisson Distribution
B.3.4
Chi-Squared Goodness of Fit Test for Poisson Distribution
B.3.5
Chi-Squared Goodness of Fit Test
B.3.6
Using the fitdistrplus R Package on Discrete Data
B.3.7
Fitting a Discrete Empirical Distribution
B.4
Modeling with Continuous Distributions
B.5
Fitting Continuous Distributions
B.5.1
Visualizing the Data
B.5.2
Statistically Summarize the Data
B.5.3
Hypothesizing and Testing a Distribution
B.5.4
Kolmogorov-Smirnov Test
B.5.5
Visualizing the Fit
B.5.6
Using the Input Analyzer
B.6
Testing Uniform (0,1) Pseudo-Random Numbers
B.6.1
Chi-Squared Goodness of Fit Tests for Pseudo-Random Numbers
B.6.2
Higher Dimensional Chi-Squared Test
B.6.3
Kolmogorov-Smirnov Test for Pseudo-Random Numbers
B.6.4
Testing for Independence and Patterns in Pseudo-Random Numbers
B.7
Additional Distribution Modeling Concepts
B.8
Summary
B.9
Exercises
C
Queueing Theory
C.1
Single Line Queueing Stations
C.1.1
Queueing Notation
C.1.2
Littleās Formula
C.1.3
Deriving Formulas for Markovian Single Queue Systems
C.2
Examples and Applications of Queueing Analysis
C.2.1
Infinite Queue Examples
C.2.2
Finite Queue Examples
C.3
Non-Markovian Queues and Approximations
C.4
Summary of Queueing Formulas
C.4.1
M/M/1 Queue
C.4.2
M/M/c Queue
C.4.3
M/M/c/k Queue
C.4.4
M/G/c/c Queue
C.4.5
M/M/1/k Queue
C.4.6
M/M/c/k Queue
C.4.7
M/M/1/k/k Queue
C.4.8
M/M/c/k/k Queue
C.5
Exercises
D
KSL Utility Packages
D.1
The
OutputDirectory
Class and
KSL
Object
D.2
Logging Options
D.3
The
KSLFileUtil
Object
D.4
CSV, Excel, and Tabular Data Files
D.5
The
DataFrameUtil
Object
D.6
KSL Database Utilities
D.7
Array Utilities
D.8
KSL Plotting Utilities
D.9
Experimental Design Utilities
D.10
Miscellaneous Utilities
E
Distributions
E.1
Discrete Distrbutions
E.2
Continuous Distrbutions
F
Statistical Tables
G
References
Published with bookdown
Simulation Modeling using the Kotlin Simulation Library (KSL)
E
Distributions