A soil biota agent based model (ABM) based on Repast4Py
The ./blossom_cpp
folder contains the model itself, and the config file needed to run the model. The filestructure should look as follows:
📁 **blossom_cpp/**
├── 📁 bin
├── 📁 build
├── 📁 configs (config files will be generated by BLOSSOM in here)
├── 📁 include (contains .hpp files)
├── 📁 outputs
│ ├── 📁 agents (will contain agent logs)
│ └── 📁 som (will contain som logs)
└── 📁 src (contains .cpp files)
In the base_config.props
file, most of the parameters can be set. One parameter can be set in src/main.cpp
: const int num_trials
where the value determines the number of trials of the base_config, using different random seeds and different N0
values for each trial.
Prerequisites:
- C++ compiler that supports C++ 20 (GCC >= 11, Clang >= 15)
- make
- Run
make
in./blossom_cpp
(make sure to setconst int num_trials
first, since this will be compiled into the executable! So everytime you change this value, first run make again, then blossom) - Run
./bin/blossom
and BLOSSOM will start to run the simulations!
The ./blossom
folder contains the model itself, notebook to create trophic networks, input files, and output files. The ./blossom_viz
folder contains notebooks for model run visualizations. The ./experiments
folder contains notebooks for analysis. The ./figures
folder contains notebooks used to create the thesis figures, including result and discussion visualizations.
Tested for Windows with WSL2 Ubuntu 22.04, and Python 3.10.7.
- Install MPI (in this case mpich, but openMPI should also work fine (not tested)):
sudo apt install mpich
- Install Python libraries to run the BLOSSOM model (consider making a venv)
env CC=mpicxx pip3 install repast4py scikit-learn
- If you encounter issues with Repast4Py, try following the Repast4Py install instructions
- Install Python libraries to run the Jupyter Notebooks (consider making a venv)
pip3 install jupyter pandas matplotlib seaborn statsmodels
- Run the model from the
./blossom
folder with the commandmpirun -n 4 python3 blossom_2d.py ./inputs/run_2d.yaml
, where-n <#_processes>
sets the number of processes that are used. NOTE:-n 1
is not supported!