Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

pruned off old envs #13

Merged
merged 2 commits into from
Jun 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 20 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,31 @@

Models:

- asm.py: provides `Asm()`. Observes 1 dimension (total N). Action is harvest
- asm_2o.py: provides `Asm2o()`. Observes 2 dimensions: total N and mean biomass (wt).
- ams_esc.py: escapement `AsmEsc()` escapement-encoded.
- `asm_env.py`: provides `AsmEnv()`. This encodes our population dynamics model, coupled with an observation process, and a harvest process with a corresponding utility model. These processes can all be modified using the `config` argument. Their defaults are defined in `asm_fns.py`. By default, observations are stock biomass and mean weight.
- `asm_esc.py`: provides `AsmEscEnv()` which inherits from `AsmEnv` and has one difference to it: actions in `AsmEscEnv()` represent escapement levels rather than fishing intensities.
- `ams_cr_like.py`: provides `AsmCRLike()`. In this environment, mean weight is observed and the action is to set parameters `(x1, x2, y2)` for a biomass-based harvest control rule of the type `CautionaryRule` (specified below).

Methods:
Strategies evaluated with MSE:

(For both 1d and 2d observations)
- MSE piecewise linear rule (in mortality space)
- Constant Mortality
- Constant escapement
- `agents.cautionary_rule.CautionaryRule`: piece-wise linear harvest-control rule specified by three parameters `(x1, x2, y2)`. Example plot (TBD).
- `agents.msy.Msy`: constant mortality harvest control rule. Specified by one parameter `mortality`.
- `agents.const_esc.ConstEsc`: constant escapement harvest control rule. Specified by one parameter `escapement`.

## Installation

## RL training:
Clone this repo, then:

```bash
cd rl4fisheries
pip install .
```

requires `rl4eco` package. Simply run `scripts/train.py` pointing at the chosen configuration. The trained model is automatically pushed to Huggingface (requires a HF token).
## RL training:

Simply run
```bash
python scripts/train.py -f hyperpars/ppo-asm2o-v0-1.yml
python scripts/train.py -f path/to/config/file.yml
```
The trained model is automatically pushed to Huggingface (requires a HF token).
The config files used for our results are found in `hyperpars/for_results/`

11 changes: 2 additions & 9 deletions src/rl4fisheries/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
# Importing from sub-directories here makes these available as 'top-level' imports
from rl4fisheries.envs.asm import Asm
from rl4fisheries.envs.asm_2o import Asm2o
from rl4fisheries.envs.asm_env import AsmEnv

from rl4fisheries.envs.asm_esc import AsmEnvEsc
from rl4fisheries.envs.asm_cr_like import AsmCRLike

Expand All @@ -13,14 +10,10 @@


from gymnasium.envs.registration import register
# action is 'harvest'
register(id="Asm-v0", entry_point="rl4fisheries.envs.asm:Asm")
# action is fishing intensity
register(id="AsmEnv", entry_point="rl4fisheries.envs.asm_env:AsmEnv")
# action is 'escapement'
register(id="AsmEnvEsc", entry_point="rl4fisheries.envs.asm_esc:AsmEnvEsc")
# action is harvest, but observes both total count and mean biomass
register(id="Asm2o-v0", entry_point="rl4fisheries.envs.asm_2o:Asm2o")
# action is harvest, but observes both total count and mean biomass
register(id="AsmEnv", entry_point="rl4fisheries.envs.asm_env:AsmEnv")
# CR-like actions
register(id="AsmCRLike", entry_point="rl4fisheries.envs.asm_cr_like:AsmCRLike")

318 changes: 0 additions & 318 deletions src/rl4fisheries/envs/asm.py

This file was deleted.

Loading
Loading