Python code for the book Sample Path Analysis and Simulation of Stochastic Systems by Nicky D. van Foreest. The book is available as PDF.
Install the following packages:
pip install random_variable latex_figuresStandard scientific Python packages (numpy, scipy, matplotlib, seaborn) are also required.
The files are listed in the order in which they appear in the book.
IBD_simulations.py: how uniform inter-arrival times lead to exponential inter-arrival times at the population levelexp_convergence.py: convergence of periodic arrivals to a uniform distribution on the circlefunctions.py: helper functions (Plus, Min, normalize, grid_search)
psychiatrists.py: psychiatrists case with holiday schedules and queue length controlnurse.py: nurse allocation between two wards with threshold controln_policy_figure.py: N-policy for switching a server on/offdiscrete_simulations.py: queue length dynamics, stability, variability, and tandem networksrandom_walk.py: random walks and their reflectionlighthouse_case.py: model parameters for the Lighthouse Company inventory casess_inventory_simulation.py: simulation of an (s,S) inventory system
waiting_time_distribution.py: exact and simulated waiting time distributions for the G/G/1 queueplot_virtual_waiting_time.py: work process and system size using heap queuesevent_stacks/: discrete-event simulation framework and examples (seeevent_stacks/readme.org)
basestock.py: base-stock inventory policy for the Lighthouse caseqr.py: (Q,r) inventory policy for the Lighthouse caseinventory_base.py: base class for inventory models using hitting time analysisTsS.py: (T,s,S) and (T,S) inventory policiesss.py: (s,S) inventory policysS_tss_experiments.py: numerical experiments comparing inventory policiesbatchqueues.py: M^B/M/1 queue with rejection policies
setups.py: effect of batch sizes on sojourn times with setup times