{"id":23765834,"url":"https://github.com/mitrefireline/simharness","last_synced_at":"2025-09-05T09:33:15.367Z","repository":{"id":211973890,"uuid":"729269937","full_name":"mitrefireline/simharness","owner":"mitrefireline","description":"An open-source Reinforcement Learning (RL) harness written in Python to work with SimFire for training agents to fight wildfires on real data.","archived":false,"fork":false,"pushed_at":"2024-09-18T21:56:45.000Z","size":11435,"stargazers_count":13,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"dev","last_synced_at":"2024-09-19T02:51:42.550Z","etag":null,"topics":["python","reinforcement-learning","simulation","wildfire"],"latest_commit_sha":null,"homepage":"https://fireline.mitre.org","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mitrefireline.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,"publiccode":null,"codemeta":null}},"created_at":"2023-12-08T19:13:31.000Z","updated_at":"2024-08-14T15:41:22.000Z","dependencies_parsed_at":"2024-03-08T21:23:22.170Z","dependency_job_id":"9296e6f2-72ff-4ccc-8cf6-2eef037f9a5b","html_url":"https://github.com/mitrefireline/simharness","commit_stats":{"total_commits":418,"total_committers":6,"mean_commits":69.66666666666667,"dds":"0.30861244019138756","last_synced_commit":"0ffdd5d0c5f0a37c96187a0bc6caa26d98001791"},"previous_names":["mitrefireline/simharness"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitrefireline%2Fsimharness","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitrefireline%2Fsimharness/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitrefireline%2Fsimharness/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitrefireline%2Fsimharness/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mitrefireline","download_url":"https://codeload.github.com/mitrefireline/simharness/tar.gz/refs/heads/dev","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":232034965,"owners_count":18463372,"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":["python","reinforcement-learning","simulation","wildfire"],"created_at":"2024-12-31T23:19:31.068Z","updated_at":"2024-12-31T23:19:37.338Z","avatar_url":"https://github.com/mitrefireline.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SimHarness -  Reinforcement Learning for Wildfire Mitigation in Simulated Disaster Environments\n\nSimHarness is a Python-based harness that wraps a [SimFire](https://github.com/mitrefireline/simfire/tree/main)\nenvironment to generate effective wildfire mitigation strategy responses via reinforcement\nlearning (RL). Through an easy-to-use API, SimHarness can train one, or multiple,\nintelligent agents within the SimFire Simulation with a variety of different RL algorithms\ndefined by [RLlib](https://docs.ray.io/en/latest/rllib/index.html).\n\nDocumentation is available [here](https://mitrefireline.github.io/simharness/).\n\n\n\u003cdiv align=\"center\"\u003e\n\u003cimg src=\"docs/images/workflow.png\" /\u003e\n\u003cfigcaption\u003e Conceptual workflow for training an RL model using SimHarness within the SimFire environment. \u003c/figcaption\u003e\n\u003c/div\u003e\n\n\n**Table of Contents**\n\n- [About SimHarness](#about-simharness)\n- [Installation](#installation)\n- [Getting Started](#getting-started)\n- [License](#license)\n- [Citation](#citation)\n\n# About SimHarness\n\nSimHarness is a Python repository designed to support the training of\n[RLlib](https://docs.ray.io/en/latest/rllib/index.html) RL algorithms within simulated\ndisaster environments defined by\n[SimFire](https://github.com/mitrefireline/simfire/tree/main). SimHarness takes as input\nan instance of the\n[SimFire Simulation class](https://github.com/mitrefireline/simfire/blob/39abc5a34b103a306c776a3c2972c10a87d0e652/simfire/sim/simulation.py#L37),\nsuch as SimFire's\n[FireSimulation](https://github.com/mitrefireline/simfire/blob/39abc5a34b103a306c776a3c2972c10a87d0e652/simfire/sim/simulation.py#L173),\nas the training environment.\nThe [Simulation](https://github.com/mitrefireline/simfire/blob/39abc5a34b103a306c776a3c2972c10a87d0e652/simfire/sim/simulation.py#L37)\nobject provides an API that allows SimHarness to move agents around the simulated\nenvironment and interact with it by placing mitigations. The\n[FireSimulation](https://github.com/mitrefireline/simfire/blob/39abc5a34b103a306c776a3c2972c10a87d0e652/simfire/sim/simulation.py#L173)\nagents represent firefighters moving through an environment as a wildfire spreads,\nplacing mitigations such as firelines to limit the spread of the fire within the area.\n\nThe SimHarness training loop functions similarly to a traditional RL training loop, except\nit expects the passed-in environment to be a child class of `Simulation` as opposed to a\n[gymnasium](https://gymnasium.farama.org) environment. `Simulation` is currently a class\nwithin the SimFire package, but is expected to be moved to a separate,\nnon-disaster-specific package in the future. The simulated environment outputs training\nsignals such as observations and rewards to the SimHarness agent(s) which use the\nobservations to predict optimal actions. The actions produced by the model provide both\n`movement` and `interaction` information. `Movements` are how the agent is traversing\nacross the environment, such as `[nothing, up, down, left, right]`. `Interactions` are how\nthe agent is changing the environment itself. In the case of SimFire, this can be\n`[nothing, fireline, wetline, scratchline]`. These actions are relayed back to the\nsimulated environment, which then affects the overall disaster scenario simulated by the\nenvironment.\n\n# Installation\n\n*Note: SimHarness has only been tested on Ubuntu 18.04 and Python 3.9.18\n\n1. **Clone the repository.**\n\n    ```bash\n    git clone https://github.com/mitrefireline/simharness.git\n    cd simharness\n    ```\n\n2. **Setup Pyenv Virtual Environment**\n\n    ```bash\n    curl https://pyenv.run | bash\n    ```\n\n    ```bash\n    export PYENV_ROOT=\"$HOME/.pyenv\"\n    command -v pyenv \u003e/dev/null || export PATH=\"$PYENV_ROOT/bin:$PATH\"\n    eval \"$(pyenv init -)\"\n    ```\n    ```bash\n    sudo apt update\n    sudo apt install \\\n    build-essential \\\n    curl \\\n    libbz2-dev \\\n    libffi-dev \\\n    liblzma-dev \\\n    libncursesw5-dev \\\n    libreadline-dev \\\n    libsqlite3-dev \\\n    libssl-dev \\\n    libxml2-dev \\\n    libxmlsec1-dev \\\n    llvm \\\n    make \\\n    tk-dev \\\n    wget \\\n    xz-utils \\\n    zlib1g-dev\n    ```\n\n    ```bash\n    pyenv install 3.9.18\n    pyenv local 3.9.18\n    ```\n\n3. **Install poetry**\n\n    ```bash\n    curl -sSL https://install.python-poetry.org | python3 -\n    ```\n\n    *Note: Don't forget to add `poetry` to your path.*\n    ```bash\n    export PATH=\"$HOME/.local/bin:$PATH\"\n    ```\n\n    ```bash\n    poetry config virtualenvs.in-project true\n    poetry env use 3.9.18\n    ```\n\n4. **Install required packages**\n\n    ```bash\n    poetry shell\n    poetry install --only main\n    ```\n\n    *Note: To re-enter the environment after this step, run `poetry shell`.*\n\n\n# Getting Started\n\nSimHarness provides a number of tutorials within the `tutorials` section of the\ndocumentation. Documentation is available [here](https://mitrefireline.github.io/simharness/).\n\n# License\n\nSimHarness is released under the [Apache 2.0 license](LICENSE).\n\n# Citation\n\nIf you use SimHarness for your work, please cite our white paper with the following BibTex entry.\n\n```BibTeX\n@misc{tapley2023simharness,\n      title={Reinforcement Learning for Wildfire Mitigation in Simulated Disaster Environments},\n      author={Alexander Tapley and Marissa Dotter and Michael Doyle and Aidan Fennelly and Dhanuj Gandikota and Savanna Smith and Michael Threet and Tim Welsh},\n      year={2023},\n      booktitle={\"Proc. of the Tackling Climate Change with Machine Learning Workshop\"},\n      series={NeurIPS},\n      howpublished={\\url{https://arxiv.org/abs/2311.15925}}\n}\n```\n\nThis project contains content developed by The MITRE Corporation. If this code is used in\na deployment or embedded within another project, it is requested that you send an email\nto opensource@mitre.org in order to let us know where this software is being used.\n\nCopyright ©2022-2023 The MITRE Corporation. ALL RIGHTS RESERVED. Approved for Public Release; Distribution Unlimited. Public Release Case Number 22-3261.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmitrefireline%2Fsimharness","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmitrefireline%2Fsimharness","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmitrefireline%2Fsimharness/lists"}