Skip to content

timovdk/BLOSSOM

Repository files navigation

BLOSSOM - BioLOgical Simulation in SOil Model

A soil biota agent based model (ABM) based on Repast4Py

C++ Instructions

The ./blossom_cpp folder contains the model itself, and the config file needed to run the model. The filestructure should look as follows:

⚠️ You probably have to create some of these folders before running BLOSSOM ⚠️

📁 **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.

Install/Run

Prerequisites:

  • C++ compiler that supports C++ 20 (GCC >= 11, Clang >= 15)
  • make
  1. Run make in ./blossom_cpp (make sure to set const int num_trials first, since this will be compiled into the executable! So everytime you change this value, first run make again, then blossom)
  2. Run ./bin/blossom and BLOSSOM will start to run the simulations!

Python Instructions

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.

alt text

Install/Run instructions

Tested for Windows with WSL2 Ubuntu 22.04, and Python 3.10.7.

  1. Install MPI (in this case mpich, but openMPI should also work fine (not tested)): sudo apt install mpich
  2. Install Python libraries to run the BLOSSOM model (consider making a venv) env CC=mpicxx pip3 install repast4py scikit-learn
  3. Install Python libraries to run the Jupyter Notebooks (consider making a venv) pip3 install jupyter pandas matplotlib seaborn statsmodels
  4. Run the model from the ./blossom folder with the command mpirun -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!

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages