https://github.com/sisl/pyrorl
An RL environment made for wildfire evacuation.
https://github.com/sisl/pyrorl
Last synced: 9 months ago
JSON representation
An RL environment made for wildfire evacuation.
- Host: GitHub
- URL: https://github.com/sisl/pyrorl
- Owner: sisl
- License: mit
- Created: 2023-07-13T02:50:32.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2025-04-02T05:38:01.000Z (about 1 year ago)
- Last Synced: 2025-09-05T22:46:02.752Z (10 months ago)
- Language: Python
- Homepage: https://sisl.github.io/PyroRL/
- Size: 4.6 MB
- Stars: 18
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: CODEOWNERS
Awesome Lists containing this project
README
██████╗ ██╗ ██╗██████╗ ██████╗ ██████╗ ██╗
██╔══██╗╚██╗ ██╔╝██╔══██╗██╔═══██╗██╔══██╗██║
██████╔╝ ╚████╔╝ ██████╔╝██║ ██║██████╔╝██║
██╔═══╝ ╚██╔╝ ██╔══██╗██║ ██║██╔══██╗██║
██║ ██║ ██║ ██║╚██████╔╝██║ ██║███████╗
╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝
 [](https://codecov.io/github/sisl/PyroRL) [](https://sisl.github.io/PyroRL/) [](https://joss.theoj.org/papers/10.21105/joss.06739)
PyroRL is a new reinforcement learning environment built for the simulation of wildfire evacuation. Check out the [docs](https://sisl.github.io/PyroRL/) and the [demo](https://www.youtube.com/embed/Pt4cI5jBbKo).
## How to Use
First, install our package. Note that PyroRL requires Python version 3.8:
```bash
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.
```python
# Create environment
kwargs = {
'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 environment
env.reset()
for _ in range(10):
# Take action and observation
action = env.action_space.sample()
observation, reward, terminated, truncated, info = env.step(action)
# Render environment and print reward
env.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](https://sisl.github.io/PyroRL/quickstart/) page on our docs website.
## How to Contribute
For information on how to contribute, check out our [contribution guide](https://sisl.github.io/PyroRL/contribution-guide/).