{"id":21173680,"url":"https://github.com/hildobby/complex_system","last_synced_at":"2025-03-14T17:45:14.298Z","repository":{"id":67885553,"uuid":"271996118","full_name":"hildobby/Complex_System","owner":"hildobby","description":"Expansion on the Bak-Sneppen model onto 2 dimensions and 3 dimensions lattices and analysis of the resulting behaviours","archived":false,"fork":false,"pushed_at":"2020-06-27T18:08:45.000Z","size":19794,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-21T11:14:55.527Z","etag":null,"topics":["bak-sneppen","complex-systems","modeling","python3"],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hildobby.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2020-06-13T11:31:35.000Z","updated_at":"2022-05-10T16:02:49.000Z","dependencies_parsed_at":"2023-05-02T13:16:33.232Z","dependency_job_id":null,"html_url":"https://github.com/hildobby/Complex_System","commit_stats":{"total_commits":113,"total_committers":4,"mean_commits":28.25,"dds":0.5221238938053097,"last_synced_commit":"b91df907febbd9cffb5a378d44833632e7c9eed4"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hildobby%2FComplex_System","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hildobby%2FComplex_System/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hildobby%2FComplex_System/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hildobby%2FComplex_System/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hildobby","download_url":"https://codeload.github.com/hildobby/Complex_System/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243623924,"owners_count":20321025,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bak-sneppen","complex-systems","modeling","python3"],"created_at":"2024-11-20T16:48:44.184Z","updated_at":"2025-03-14T17:45:14.272Z","avatar_url":"https://github.com/hildobby.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"Expanding and exploring the Bak-Sneppen model written in Python 3+\n=========================================\n2 dimensions and 3 dimensions Bak-Snappen model, evaluation of the resulting model behaviour and effect of various parameters.\n\nBy: [Hildebert Moulié](https://github.com/hildobby), [Philippe Nicolau](https://github.com/PNicolau96), [Louis Weyland](https://github.com/LouisWW) \u0026 [Binjie Zhou](https://github.com/binjiezhou).\n\n\u003cp float=\"left\" align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/hildobby/Complex_System/blob/master/src/figures/lattice_itr%3D1.png\" width=\"400\" /\u003e\n  \u003cimg src=\"https://github.com/hildobby/Complex_System/blob/master/src/figures/lattice-age_itr%3D2000.png\" width=\"400\" /\u003e \n\u003c/p\u003e\n\n## Project Plan\n1. Bring the 1 dimension Bak-Snappen model to 2 dimensions and 3 dimensions\n2. Evaluate different results from the model:\n    * Avalanche time and compare it between several models\n    * Mutation distance\n    * Cluster sizes\n    * Evolutionary time\n3. Test the data with the [powerlaw](https://pypi.org/project/powerlaw/) package\n\n## Overview of some of the results\n\n### Fitness over time\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/hildobby/Complex_System/blob/master/src/figures/average_fitness_s%3D(20%2C%2020)_itr%3D2000_rep%3D10_std%3D0.3.png\" /\u003e\n\u003c/p\u003e\n\n### Impact of percentage of empty node\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/hildobby/Complex_System/blob/master/src/figures/avalanche_empy_space_percentage_comparison.png\" /\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/hildobby/Complex_System/blob/master/src/figures/threshold_empy_space_percentage_comparison.png\" /\u003e\n\u003c/p\u003e\n\n### Cluster size distribution for different grid sizes\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/hildobby/Complex_System/blob/master/src/figures/cluster-sizes_rep=2000.png\" /\u003e\n\u003c/p\u003e\n\n## Working with the repository\n\nIn order to locally gather the required packages, the following command can be called:\n```\npip3 install -r requirements.txt\n```\nThe code for the model is located in `src/lattice.py` and the graphs can be generated by calling the different functions in `src/main.py`. The file `results_presentation.ipynb` that was used to create the presentation of this project shows how the result figures as shown above can be generated.\n\nRunning the `./lattice.py` function in the bash shell will create a Bak-Sneppen model with a grid size of 20X20 and will plot the average fitness, avalanche time, the cluster size distribution and a visualisation of the grid itself. \n\nIn `main.py`, various statistical analysis are generated. The various function can be called using the following command where `itr` represent the number of steps in the Bak-Sneppen Model:\n```\n./main.py -func function_example -itr=200\n```\n\nFor further details please run the following command which shows which function can be called and what other paramters can be tuned from the command line:\n```\n./main.py --help\n```\n\nGenerating the presentation from the `results_presentation.ipynb` Jupyter notebook\n```\njupyter nbconvert results_presentation.ipynb --to slides --post serve\n```\n\n## References\n* Alstott, J., Bullmore, E., \u0026 Plenz, D. (2014). powerlaw: a Python package for analysis of heavy-tailed distributions. PloS one, 9(1), e85777.\n* Bak, P., \u0026 Sneppen, K. (1993). Punctuated equilibrium and criticality in a simple model of evolution. Physical review letters, 71(24), 4083.\n* Fraiman, D. (2018). Bak-Sneppen model: Local equilibrium and critical value. Physical Review E, 97(4), 042123.\n* Paczuski, M., Maslov, S., \u0026 Bak, P. (1996). Avalanche dynamics in evolution, growth, and depinning models. Physical Review E, 53(1), 414.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhildobby%2Fcomplex_system","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhildobby%2Fcomplex_system","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhildobby%2Fcomplex_system/lists"}