Skip to content

Commit

Permalink
Add more instructions to README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
greg-neustroev committed Feb 2, 2022
1 parent c6f6a51 commit c10326b
Showing 1 changed file with 46 additions and 6 deletions.
52 changes: 46 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,50 @@
This repository contains the source code and data for the experiments presented in
_Deep Reinforcement Learning for Active Wake Control_.

## How to replicate the experiments
## How to Use This Repository

Because each experiment has many parameters, we use configuration files to describe each experiment. The configuration files for the experiments presented in the paper can be found in `./code/configs`: `action_representations_*.yml` for the action representation experiment (Section 4.1), and `noisy_*.yml` for the noisy observation experiment (Section 4.2). You can also create new configuration files to run your own experiments.
### Replicating the Experiments

To replicate the experiments in the paper, run `python3 code/main.py --config CONFIG_FILE`, where `CONFIG_FILE` is a path to a configuration file.
The output data is written to a directory specified in the configuration, in Tensorboard format. You can use `./code/tensorboard_to_csv.py --path PATH` to convert the output from `PATH` to a `.csv`-file.
Because each experiment has many parameters, we use configuration files to describe each experiment. The configuration
files for the experiments presented in the paper can be found in `./code/configs`: `action_representations_*.yml` for
the action representation experiment (Section 4.1), and `noisy_*.yml` for the noisy observation experiment
(Section 4.2). You can also create new configuration files to run your own experiments.

Make sure that you are using Python 3.8 or newer. You also need to install required packages by running
`python3 -m pip install -r requirements.txt` from the project's folder.

To replicate the experiments in the paper, run `python3 code/main.py --config CONFIG_FILE`, where `CONFIG_FILE` is a
path to a configuration file. The output data is written to a directory specified in the configuration, in Tensorboard
format. You can use `./code/tensorboard_to_csv.py --path PATH` to convert the output from `PATH` to a `.csv`-file.

### Building from the Source Code

If you are interested in using the wind farm environment with your own reinforcement learning agents, you can build and
install a Python package that will make the environment available on your machine.

First, make sure that you have `build` installed by running `python3 -m pip install --upgrade build`.

Next, build the package by running `python3 -m build` from the project's directory. This will create `./dist` with
a `wind_farm_gym-VERSION-py3-none-any.whl` file in it, where `VERSION` is the current release version.

Finally, install the package by running `python3 -m pip install wind_farm_gym-VERSION-py3-none-any.whl`, or
`python3 -m pip install wind_farm_gym-VERSION-py3-none-any.whl --force-reinstall` if you want to reinstall an existing
installation. This should install the package and its dependencies.

To test that the package is available and working, you can run the following script:
```python
from wind_farm_gym import WindFarmEnv

# Initialize the environment with 3 turbines positioned 750 meters apart in a line
env = WindFarmEnv(turbine_layout=([0, 750, 1500], [0, 0, 0]))

obs = env.reset()
for _ in range(1000): # Repeat for 1000 steps
a = env.action_space.sample() # Choose an action randomly
obs, reward, _, _ = env.step(a) # Perform the action
env.render() # Render the environment; remove this line to speed up the process
env.close()
```

## Contents

Expand All @@ -18,10 +56,12 @@ The output data is written to a directory specified in the configuration, in Ten
- `config` for configuration files used in the experiments;
- `wind_farm_gym` for the environment.
- `./data` contains the datasets used in the paper:
- `wind_data` contains the measurements from Hollandse Kust Noord (site B) used to estimate the transition model in Section 3.4.
- `wind_data` contains the measurements from Hollandse Kust Noord (site B) used to estimate the transition model in
Section 3.4.
- the other subdirectories contain the results of the experiments:
- `action_representations_tunnel` for the experiment presented in Section 4.1.
- `noisy_1` .. `noisy_7` for the experiment presented in Section 4.2; each folder corresponds to a different level of noise, 1% .. 7%.
- `noisy_1` ... `noisy_7` for the experiment presented in Section 4.2; each folder corresponds to a different
level of noise, 1% ... 7%.

## Citation

Expand Down

0 comments on commit c10326b

Please sign in to comment.