simfire

An open-source wildfire simulator written in Python and meant to be used to train reinforcement learning (RL) agents.

https://github.com/mitrefireline/simfire

Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (12.5%) to scientific vocabulary

Keywords

python reinforcement-learning reinforcement-learning-environments simulation simulator wildfire

Keywords from Contributors

mesh sequences interactive hacking network-simulation
Last synced: 6 months ago · JSON representation ·

Repository

An open-source wildfire simulator written in Python and meant to be used to train reinforcement learning (RL) agents.

Basic Info
Statistics
  • Stars: 41
  • Watchers: 1
  • Forks: 6
  • Open Issues: 8
  • Releases: 3
Topics
python reinforcement-learning reinforcement-learning-environments simulation simulator wildfire
Created over 3 years ago · Last pushed over 1 year ago
Metadata Files
Readme License Citation

README.md

SimFire Fire Simulator

Introduction

SimFire uses PyGame to display and simulate different fire spread models, including the Rothermel Surface fire spread model described in this paper.

For more comprehensive documentation, go to our docs page.

This repository is part of the MITRE Fireline project and is associated with both BurnMD and SimHarness. BurnMD is used in the HistoricalDataLayer to provide historical fire data for the simulation. SimHarness is a reinforcement learning training harness that uses this simulator to train agents to fight fires.

Running the Simulation


Left: Fire simulated near Julian, CA. Right: Fire simulated near Reno, NV.
Both fires have winds from the east at 20mph

Install simfire by following the installation instructions. Then run the run_game.py script:

shell python run_game.py

Running as a Python Module

```python from simfire.sim.simulation import FireSimulation from simfire.utils.config import Config

config = Config("configs/operational_config.yml") sim = FireSimulation(config)

Run a 1 hour simulation

sim.run("1h")

Run the same simulation for 30 more minutes

sim.run("30m")

Render the next 2 hours of simulation

sim.rendering = True sim.run("2h")

Now save a GIF and fire spread graph from the last 2 hours of simulation

sim.savegif() sim.savespread_graph()

Saved to the location specified in the config: simulation.sf_home

Update agents for display

(x, y, agent_id)

agent0 = (5, 5, 0) agent1 = (5, 5, 1)

agents = [agent0, agent1]

Create the agents on the display

sim.updateagentpositions(agents)

Loop through to move agents

for i in range(5): agent0 = (5 + i, 5 + i, 0) agent1 = (5 + i, 5 + i, 1) # Update the agent positions on the simulation sim.updateagentpositions([agent0, agent1]) # Run for 1 update step sim.run(1)

Turn off rendering so the display disappears and the simulation continues to run in the

background

sim.rendering = False ```

Installing the Package

shell pip install simfire

Contributing

For contributing, see the Contribution Page in our docs.

Citation

To cite this software, use the “Cite this repository” link built into GitHub on the right.

Copyright

Copyright ©2023 The MITRE Corporation. ALL RIGHTS RESERVED. Approved for Public Release; Distribution Unlimited. Public Release Case Number 22-3261.

Owner

  • Name: MITRE fiReLine
  • Login: mitrefireline
  • Kind: organization
  • Email: fireline@mitre.org

Citation (CITATION.cff)

# This CITATION.cff file was generated with cffinit.
# Visit https://bit.ly/cffinit to generate yours today!

cff-version: 1.2.0
title: SimFire
message: >-
  If you use this software, please cite it using the metadata from this file.
type: software
authors:
  - given-names: Michael
    family-names: Doyle
    email: mdoyle@mitre.org
    affiliation: MITRE
    orcid: 'https://orcid.org/0009-0002-0229-5693'
  - given-names: Michael
    family-names: Threet
    email: mthreet@mitre.org
    affiliation: MITRE
  - given-names: Marissa
    family-names: Dotter
    email: mdotter@mitre.org
    affiliation: MITRE
  - given-names: Chris
    family-names: Kempis
    email: ckempis@mitre.org
    affiliation: MITRE
  - given-names: Alex
    family-names: Tapley
    email: atapley@mitre.org
    affiliation: MITRE
  - given-names: Tim
    family-names: Welsh
    email: twelsh@mitre.org
    affiliation: MITRE
repository-code: 'https://github.com/mitrefireline/simfire'
url: 'https://fireline.mitre.org'
repository-artifact: 'https://pypi.org/project/simfire/'
abstract: >-
  SimFire uses PyGame to display and simulate different fire spread models, including the Rothermel Surface fire spread model.
keywords:
  - simulator
  - reinforcement learning
  - wildfire
  - fire
  - python
license: Apache-2.0
version: 2.0.1
date-released: '2024-07-08'

GitHub Events

Total
  • Issues event: 5
  • Watch event: 10
  • Delete event: 1
  • Issue comment event: 3
  • Push event: 3
  • Pull request review event: 4
  • Pull request review comment event: 2
  • Pull request event: 1
  • Fork event: 3
  • Create event: 1
Last Year
  • Issues event: 5
  • Watch event: 10
  • Delete event: 1
  • Issue comment event: 3
  • Push event: 3
  • Pull request review event: 4
  • Pull request review comment event: 2
  • Pull request event: 1
  • Fork event: 3
  • Create event: 1

Committers

Last synced: 7 months ago

All Time
  • Total Commits: 783
  • Total Committers: 10
  • Avg Commits per committer: 78.3
  • Development Distribution Score (DDS): 0.502
Past Year
  • Commits: 80
  • Committers: 7
  • Avg Commits per committer: 11.429
  • Development Distribution Score (DDS): 0.5
Top Committers
Name Email Commits
Michael Doyle m****e@m****g 390
Michael Threet m****t@m****g 154
mdotter m****r@m****g 95
Chris Kempis c****s@m****g 47
fiReLine CI Bot f****t@m****g 46
Alex Tapley a****y@m****g 18
Aidan Fennelly a****y@m****g 14
dependabot[bot] 4****] 14
Welsh t****h@m****n 4
Aidan Fennelly 1****e 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 12
  • Total pull requests: 23
  • Average time to close issues: 19 days
  • Average time to close pull requests: 5 days
  • Total issue authors: 7
  • Total pull request authors: 5
  • Average comments per issue: 0.92
  • Average comments per pull request: 1.09
  • Merged pull requests: 21
  • Bot issues: 0
  • Bot pull requests: 14
Past Year
  • Issues: 4
  • Pull requests: 1
  • Average time to close issues: about 2 hours
  • Average time to close pull requests: about 2 hours
  • Issue authors: 4
  • Pull request authors: 1
  • Average comments per issue: 0.25
  • Average comments per pull request: 1.0
  • Merged pull requests: 1
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • afennelly-mitre (5)
  • doyled-it (4)
  • malintha (1)
  • evansbeth (1)
  • PanosParaschidis (1)
  • dependabot[bot] (1)
  • ufuk-cakir (1)
  • JestradaG (1)
Pull Request Authors
  • dependabot[bot] (27)
  • doyled-it (8)
  • afennelly-mitre (6)
  • mdotter-mitre (2)
  • atapley (1)
Top Labels
Issue Labels
documentation (3) operational (2) bug (2) question (1) fuel (1) dependencies (1) size:XS (1) lgtm (1) version:patch (1) planned (1) version (1)
Pull Request Labels
lgtm (37) size:XS (28) dependencies (27) size:M (6) size:S (2) version (2) version:patch (2) enhancement (2) operational (2) size:XL (2) historical (2)

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 94 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 1
  • Total versions: 24
  • Total maintainers: 1
pypi.org: simfire

Fire simulator built in Python

  • Versions: 24
  • Dependent Packages: 0
  • Dependent Repositories: 1
  • Downloads: 94 Last month
Rankings
Dependent packages count: 10.1%
Downloads: 14.5%
Average: 19.8%
Dependent repos count: 21.5%
Stargazers count: 23.1%
Forks count: 29.8%
Maintainers (1)
Last synced: 6 months ago

Dependencies

.github/workflows/pages.yml actions
  • JamesIves/github-pages-deploy-action v4 composite
  • actions/checkout v1 composite
.github/workflows/publish.yml actions
  • actions/checkout v1 composite
poetry.lock pypi
  • 121 dependencies
pyproject.toml pypi
  • Pillow ^9.1.1
  • PyYAML ^6.0
  • geotiff ^0.2.10
  • h5py ^3.7.0
  • imagecodecs ^2023.7.10
  • jsonlines ^3.1.0
  • landfire ^0.5.0
  • matplotlib ^3.5.2
  • noise ^1.2.2
  • numpy ^1.22.4
  • opencv-python ^4.7.0.72
  • pygame ^2.1.2
  • python ~3.9
  • reportlab ^3.6.10
  • rich ^12.5.1
  • scikit-image ^0.19.3
  • svglib ^1.3.0
  • wurlitzer ^3.0.2