Skip to main content

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:

python run_game.py

Running as a Python Module

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.save_gif()
sim.save_spread_graph()
# Saved to the location specified in the config: simulation.sf_home

# Update agents for display
# (x, y, agent_id)
agent_0 = (5, 5, 0)
agent_1 = (5, 5, 1)

agents = [agent_0, agent_1]

# Create the agents on the display
sim.update_agent_positions(agents)

# Loop through to move agents
for i in range(5):
    agent_0 = (5 + i, 5 + i, 0)
    agent_1 = (5 + i, 5 + i, 1)
    # Update the agent positions on the simulation
    sim.update_agent_positions([agent_0, agent_1])
    # 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

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.

Release files for simfire 2.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for simfire 2.0.1
File Size Uploaded
simfire-2.0.1.tar.gz 439.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for simfire 2.0.1
File Interpreter ABI Platform
simfire-2.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 893.7 kB

Release files / simfire-2.0.1.tar.gz

Download URL simfire-2.0.1.tar.gz
Size 439.2 kB
Tags Source
SHA-256 checksum
How to use checksums
f751d381aab3ac02f55ccd17e5a2b84fe99826cf2dc07ed64383bcb09e7fdbdb
BLAKE2b-256 checksum
How to use checksums
ef4d6a64e95335913f84f67bc069470532fcc4db5082b3bce4b79979e6979775
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.9.19 Linux/6.5.0-1022-azure

Release files / simfire-2.0.1-py3-none-any.whl

Download URL simfire-2.0.1-py3-none-any.whl
Size 454.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
695ae4155b15ec3764bba4f1cca5e2ea8815313b4ec8878baa12d14a8407b0d8
BLAKE2b-256 checksum
How to use checksums
aab2e936302db9644a2248fa5465e96585ae7439de8beb1e223ec3f2620ed7ae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.9.19 Linux/6.5.0-1022-azure

Release history Release notifications | RSS feed

This release

2.0.1 This release

2 release files

2.0.0

2 release files

1.5.9

2 release files

1.5.8

2 release files

1.5.7

2 release files

1.5.6

2 release files

1.5.5

2 release files

1.5.4

2 release files

1.5.3

2 release files

1.5.2

2 release files

1.5.1

2 release files

1.5.0

2 release files

1.4.37

2 release files

1.4.36

2 release files

1.4.35

2 release files

1.4.33

2 release files

1.4.31

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page