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
PyroRL is a new reinforcement learning environment built for the simulation of wildfire evacuation. Check out the docs and the demo.
How to Use
First, install our package. Note that PyroRL requires Python version 3.8:
pip install pyrorl
To use our wildfire evacuation environment, define the dimensions of your grid, where the populated areas are, the paths, and which populated areas can use which path. See an example below.
# Create environmentkwargs= {
'num_rows': num_rows,
'num_cols': num_cols,
'populated_areas': populated_areas,
'paths': paths,
'paths_to_pops': paths_to_pops
}
env=gymnasium.make('pyrorl/PyroRL-v0', **kwargs)
# Run a simple loop of the environmentenv.reset()
for_inrange(10):
# Take action and observationaction=env.action_space.sample()
observation, reward, terminated, truncated, info=env.step(action)
# Render environment and print rewardenv.render()
print("Reward: "+str(reward))
A compiled visualization of numerous iterations is seen below. For more examples, check out the examples/ folder.
For a more comprehensive tutorial, check out the quickstart page on our docs website.