Skip to content

artificial-life-lab/population-dynamics

Repository files navigation

Population dynamics

License PyPI codecov

Library to conduct experiements on population dynamics.

Lotka-Volterra predator-prey system

Installation

  • To generate required log and results directories, run
bash init.sh
  • Create virtual environment
mkdir -p ~/venvs/population-dynamics
python3 -m venv ~/venvs/population-dynamics
  • Activate virtual environment
source ~/venvs/population-dynamics/bin/activate
  • Upgrade pip and setuptools
pip install --upgrade pip setuptools
  • install dependencies with
pip install -r requirements.txt
  • Install causal_inference as a package within the environment
python setup.py develop

Running the Lotka-Volterra simulation

  • The Lotka-Volterra simulator class exists in repo/causal_inference/base/lv_simulator.py.

  • The Lotka-Volterra simulation parameters are fetched from repo/causal_inference/config.py. You can edit the config.py file directly to play around with the parameter values.

  • You can run the simulator directly from terminal by running

python causal_inference/base/lv_simulator.py
  • The simulation statistics will be saved in the repo/results directory.