{"id":13724053,"url":"https://github.com/dos-group/leaf","last_synced_at":"2026-03-10T09:02:07.554Z","repository":{"id":40297737,"uuid":"332009339","full_name":"dos-group/leaf","owner":"dos-group","description":"Simulator for modeling energy consumption in cloud, fog, and edge computing environments 🌱","archived":false,"fork":false,"pushed_at":"2024-04-02T07:53:34.000Z","size":1214,"stargazers_count":117,"open_issues_count":0,"forks_count":14,"subscribers_count":13,"default_branch":"main","last_synced_at":"2026-03-08T02:06:16.293Z","etag":null,"topics":["edge-computing","energy-consumption","fog-computing","modeling","simulation"],"latest_commit_sha":null,"homepage":"https://leaf.readthedocs.io","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dos-group.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2021-01-22T17:00:06.000Z","updated_at":"2026-02-28T22:03:04.000Z","dependencies_parsed_at":"2024-04-13T20:03:32.465Z","dependency_job_id":null,"html_url":"https://github.com/dos-group/leaf","commit_stats":{"total_commits":41,"total_committers":2,"mean_commits":20.5,"dds":"0.024390243902439046","last_synced_commit":"413129e88909811cb5c24c78bc2b6796e256f8fe"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/dos-group/leaf","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dos-group%2Fleaf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dos-group%2Fleaf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dos-group%2Fleaf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dos-group%2Fleaf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dos-group","download_url":"https://codeload.github.com/dos-group/leaf/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dos-group%2Fleaf/sbom","scorecard":{"id":352812,"data":{"date":"2025-08-11","repo":{"name":"github.com/dos-group/leaf","commit":"413129e88909811cb5c24c78bc2b6796e256f8fe"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.8,"checks":[{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":0,"reason":"Found 0/27 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/main.yml:1","Warn: no topLevel permission defined: .github/workflows/publish.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/dos-group/leaf/main.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/dos-group/leaf/main.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/dos-group/leaf/publish.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/dos-group/leaf/publish.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/publish.yml:26: update your workflow using https://app.stepsecurity.io/secureworkflow/dos-group/leaf/publish.yml/main?enable=pin","Warn: pipCommand not pinned by hash: .github/workflows/main.yml:24","Warn: pipCommand not pinned by hash: .github/workflows/main.yml:25","Warn: pipCommand not pinned by hash: .github/workflows/publish.yml:20","Warn: pipCommand not pinned by hash: .github/workflows/publish.yml:21","Info:   0 out of   4 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned","Info:   0 out of   4 pipCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 7 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-18T08:45:23.708Z","repository_id":40297737,"created_at":"2025-08-18T08:45:23.708Z","updated_at":"2025-08-18T08:45:23.708Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30243779,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-08T00:58:18.660Z","status":"online","status_checked_at":"2026-03-08T02:00:06.215Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["edge-computing","energy-consumption","fog-computing","modeling","simulation"],"created_at":"2024-08-03T01:01:49.258Z","updated_at":"2026-03-10T09:02:07.527Z","avatar_url":"https://github.com/dos-group.png","language":"Python","funding_links":[],"categories":["Consumption"],"sub_categories":["Computation and Communication"],"readme":"# LEAF [![PyPI version](https://img.shields.io/pypi/v/leafsim.svg?color=52c72b)](https://pypi.org/project/leafsim/) [![Supported versions](https://img.shields.io/pypi/pyversions/leafsim.svg)](https://pypi.org/project/leafsim/) [![License](https://img.shields.io/pypi/l/leafsim.svg)](https://pypi.org/project/leafsim/)\n\n\u003cimg align=\"right\" width=\"300\" height=\"230\" src=\"https://leaf.readthedocs.io/en/latest/_static/logo.svg\"\u003e\n\nLEAF is a simulator for analytical modeling of energy consumption in cloud, fog, or edge computing environments.\nIt enables the modeling of simple tasks running on a single node as well as complex application graphs in distributed, heterogeneous, and resource-constrained infrastructures.\nLEAF is based on [SimPy](https://simpy.readthedocs.io/en/latest/) for discrete-event simulation and [NetworkX](https://networkx.org/) for modeling infrastructure or application graphs.\n\nPlease have a look at out [examples](https://github.com/dos-group/leaf/tree/main/examples) and visit the official [documentation](https://leaf.readthedocs.io) for more information on this project.\n\nThis Python implementation was ported from the [original Java protoype](https://www.github.com/birnbaum/leaf).\nAll future development will take place in this repository.\n\n\n## ⚙️ Installation\n\nYou can install the [latest release](https://pypi.org/project/leafsim/) of LEAF via [pip](https://pip.pypa.io/en/stable/quickstart/):\n\n```\n$ pip install leafsim\n```\n\nAlternatively, you can also clone the repository (including all examples) and set up your environment via:\n\n```\n$ pip install -e .\n```\n\n\n## 🚀 Getting started\n\nLEAF uses [SimPy](https://simpy.readthedocs.io/en/latest/) for process-based discrete-event simulation and adheres to their API.\nTo understand how to develop scenarios in LEAF, it makes sense to familiarize yourself with SimPy first.\n\n```python\nimport simpy\nfrom leaf.application import Task\nfrom leaf.infrastructure import Node\nfrom leaf.power import PowerModelNode, PowerMeter\n\n# Processes modify the model during the simulation\ndef place_task_after_2_seconds(env, node, task):\n    \"\"\"Waits for 2 seconds and places a task on a node.\"\"\"\n    yield env.timeout(2)\n    task.allocate(node)\n\nnode = Node(\"node1\", cu=100, power_model=PowerModelNode(max_power=30, static_power=10))\ntask = Task(cu=100)\npower_meter = PowerMeter(node, callback=lambda m: print(f\"{env.now}: Node consumes {int(m)}W\"))\n\nenv = simpy.Environment()  \n# register our task placement process\nenv.process(place_task_after_2_seconds(env, node, task))\n# register power metering process (provided by LEAF)\nenv.process(power_meter.run(env))\nenv.run(until=5)\n```\n\nWhich will result in the output:\n\n```\n0: Node consumes 10W\n1: Node consumes 10W\n2: Node consumes 30W\n3: Node consumes 30W\n4: Node consumes 30W\n```\n\nFor other examples, please refer to the [examples folder](https://github.com/dos-group/leaf/blob/main/examples).\n\n\n## 🍃 What can I do with LEAF?\n\nLEAF enables high-level simulation of computing scenarios, where experiments are easy to create and easy to analyze.\nBesides allowing research on scheduling and placement algorithms on resource-constrained environments, LEAF puts a special focus on:\n\n- **Dynamic networks**: Simulate mobile nodes which can join or leave the network during the simulation.\n- **Power consumption modeling**: Model the power usage of individual compute nodes, network traffic, and applications.\n- **Energy-aware algorithms**: Implement dynamically adapting task placement strategies, routing policies, and other energy-saving mechanisms.\n- **Scalability**: Model the execution of thousands of compute nodes and applications in magnitudes faster than real time.\n\nPlease visit the official [documentation](https://leaf.readthedocs.io) for more information and examples on this project.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"/docs/_static/infrastructure.png\"\u003e\n\u003c/p\u003e\n\n\n## 📖 Publications\n\nIf you use LEAF in your research, please cite our paper:\n\nPhilipp Wiesner and Lauritz Thamsen. \"[LEAF: Simulating Large Energy-Aware Fog Computing Environments](https://ieeexplore.ieee.org/document/9458907)\" In the Proceedings of the 2021 *5th IEEE International Conference on Fog and Edge Computing (ICFEC)*. IEEE. 2021 [[arXiv preprint]](https://arxiv.org/pdf/2103.01170.pdf) [[video]](https://youtu.be/G70hudAhd5M)\n\nBibtex:\n```\n@inproceedings{WiesnerThamsen_LEAF_2021,\n  author={Wiesner, Philipp and Thamsen, Lauritz},\n  booktitle={2021 IEEE 5th International Conference on Fog and Edge Computing (ICFEC)}, \n  title={{LEAF}: Simulating Large Energy-Aware Fog Computing Environments}, \n  year={2021},\n  pages={29-36},\n  doi={10.1109/ICFEC51620.2021.00012}\n}\n```\n\n## 💚 Projects using LEAF\n\n- Shivani Tripathi, Praveen Kumar, Priyadarshni Gupta, Rajiv Misra, and T.N. Singh. \"[Workload Shifting Based on Low Carbon Intensity Periods: A Framework for Reducing Carbon Emissions in Cloud Computing]()\". *2023 IEEE International Conference on Big Data (BigData)*. IEEE. 2023.\n- Rui Zhang, Xuesen Chu, Ruhui Ma, Meng Zhang, Liwei Lin, Honghao Gao, and Haibing Guan. \"[OSTTD: Offloading of Splittable Tasks with Topological Dependence in Multi-Tier Computing Networks](https://ieeexplore.ieee.org/abstract/document/9978666)\". *IEEE Journal on Selected Areas in Communications*. 2022.\n- Zizheng Liu. \"A Web-Based User Interface for the LEAF Simulator\". *MSc IT+ Dissertation* at U of Glasgow. 2022 [[code](https://github.com/ZZZZZZZZZED/leaf-GUI)]\n- Yana Kernerman. \"Interactive Visualization of Energy Consumption in Edge and Fog Computing Simulations\". *Bachelor Thesis* at TU Berlin. 2022 [[code](https://github.com/dos-group/leaf/tree/gui)]\n- Sangeeta Kakati and Rupa Deka. \"[Computational and Adaptive Offloading in Edge/Fog based IoT Environments](https://ieeexplore.ieee.org/document/9847743).\" *2nd International Conference on Intelligent Technologies (CONIT)*. IEEE. 2022\n- Philipp Wiesner, Ilja Behnke, Dominik Scheinert,  Kordian Gontarska, and Lauritz Thamsen. \"[Let's Wait Awhile: How Temporal Workload Shifting Can Reduce Carbon Emissions in the Cloud](https://arxiv.org/pdf/2110.13234.pdf)\". *22nd International Middleware Conference*. ACM. 2021 [[code](https://github.com/dos-group/lets-wait-awhile)]\n- Liam Brugger. \"An Evaluation of Carbon-Aware Load Shifting Techniques\". *Bachelor Thesis* at TU Berlin. 2021 [[code](https://gitlab.com/lbrugger72/Bachelor)]\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdos-group%2Fleaf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdos-group%2Fleaf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdos-group%2Fleaf/lists"}