You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
fromsimfire.sim.simulationimportFireSimulationfromsimfire.utils.configimportConfigconfig=Config("configs/operational_config.yml")
sim=FireSimulation(config)
# Run a 1 hour simulationsim.run("1h")
# Run the same simulation for 30 more minutessim.run("30m")
# Render the next 2 hours of simulationsim.rendering=Truesim.run("2h")
# Now save a GIF and fire spread graph from the last 2 hours of simulationsim.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 displaysim.update_agent_positions(agents)
# Loop through to move agentsforiinrange(5):
agent_0= (5+i, 5+i, 0)
agent_1= (5+i, 5+i, 1)
# Update the agent positions on the simulationsim.update_agent_positions([agent_0, agent_1])
# Run for 1 update stepsim.run(1)
# Turn off rendering so the display disappears and the simulation continues to run in the# backgroundsim.rendering=False