This repository contains all code for running a simulation which examines the effects of ML adoption on organizational learning (OL). All models are based on the agent-based model developed by James March (1991) and use the Mesa framework (Python) as technical foundation.
The following files are included in this repository:
utils/
: Utility functions for batch runners, configuration and data preprocessingmodels/
: Actual simulation models (separated into agent and model definitions), along with utility functions for agent initialization and metric calculationnbs/
: Notebooks used for testing model implementations, speedups (e.g., matrix-based metric calculations)data/
: Collected data from simulation runs will be saved here/
: Run script and environment configuration
All simulations should be run in a virtual environment in order to create a standardized and reproducible environment.
The following assumptions are made about your system:
- Working installation of Git
- Working installation of Python (at least version 3.7)
- Working shell for running command-line instructions (e.g., Git Bash, VS Code or PyCharm terminal)
The following setup steps have to be completed in order to run simulations:
- Clone repository to target machine:
git clone git@github.com:felixpeters/ml-ol-simulation.git
orgit clone https://github.com/felixpeters/ml-ol-simulation.git
- Navigate to repository directory:
cd ml-ol-simulation
(on UNIX-based systems) - Create
data
folder in repository root:mkdir data
(on UNIX-based systems) - Setup a virtual environment:
python -m venv venv
- Activate virtual environment:
source venv/bin/activate
(on UNIX-based systems) - Install required packages:
pip install -r requirements.txt
The logic for running simulations is included in the run script (run.py
) in the project root. The script is meant to be run in the virtual environment.
Model runs can be configured using constants (see line starting # define constants
). In detail, the following parameters can be set:
MODEL_NAME
: Determine the model to be run, currentlybase
oralt
DATA_PATH
: Leave this untouched if you followed the setup instructions aboveCPU_COUNT
: Set this to a fixed number if you wish, otherwise all available CPU cores will be usedCONFIG
: Determines which parameter set to use for simulation run, seeutils/config.py
for details
Conduct the following steps to run the simulation:
- Activate the virtual environment (if it isn't already):
source venv/bin/activate
- Run the simulation:
python run.py
The runtime can be estimated from the output of the run script (iteration speed is updated continuously).
Email: peters@is.tu-darmstadt.de