Package containing some simple models and methods used for simulation
The library currently has support for bernoulli ranking and selection procedures, system output comparison, and simple simulation models.
You can install the package by running the following command:
pip install git+https://github.com/bsatterwhite3/simulation-methods.git
The following example shows how to run one of the Bernoulli selection procedures. These procedures require the caller to create an interface to their system by extending the BernoulliPopulation and implementing a generate_outcome method that returns a 1 or a 0. This example will take 1000 samples max from each population to try to determine a winner.
from simulation_methods.procedures import GenericBernoulliPopulation, BernoulliBechhoferKulkarni
population_A = GenericBernoulliPopulation(prob=0.2)
population_B = GenericBernoulliPopulation(prob=0.8)
bernoulli_bk = BernoulliBechhoferKulkarni([population_A, population_B], max_samples=1000)
winner = bernoulli_bk.select_best_population() # Winner would most likely be population_B because 80% >> 20%
procedures.py
: contains implementations from various papers on ranking/selection proceduresmethods.py
: contains methods for comparing outputs of simulationsmodels.py
: contains models that can be used for simulation, like Brownian Motion
To install the application for local development:
- Create virtual environment of your choice with Python 3.7 installed (
conda
,virtualenv
,pyenv
, etc.) - Run
python setup.py install
This will install the project on your local machine along with the libraries listed in the requirements.txt
file.
Once the project is installed locally, run pip install -r test-requirements.txt
to install the packages for testing.
Then run python -m pytest tests
to run the tests.
This project is licensed under the MIT License - see the LICENSE file for details