Skip to content

Commit

Permalink
Merge pull request #35 from JdeRobot/fixture/entrypoint
Browse files Browse the repository at this point in the history
Fixture/entrypoint
  • Loading branch information
igarag authored Jan 16, 2022
2 parents 55656fb + 206564f commit e2d6b24
Show file tree
Hide file tree
Showing 30 changed files with 3,027 additions and 390 deletions.
15 changes: 15 additions & 0 deletions rl_studio/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Run RL Studio

## Usage

You can run a simple RLStudio trainer typing:

```bash
python main_rlstudio.py -n qlearn -a f1 -e simple -f config.yaml
```

Open the `config.yaml` file and set the params you need.

## Project diagram

![](./docs/rlstudio-diagram.png)
20 changes: 20 additions & 0 deletions rl_studio/agents/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
from rl_studio.agents.agents_type import AgentsType
from rl_studio.agents.exceptions import NoValidTrainingType


class TrainerFactory:
def __new__(cls, config):

agent = config.agent["name"]

if agent == AgentsType.F1.value:
from rl_studio.agents.f1.train_qlearn import F1Trainer
return F1Trainer(config)

elif agent == AgentsType.TURTLEBOT.value:
from rl_studio.agents.turtlebot.turtlebot_trainer import TurtlebotTrainer

return TurtlebotTrainer(config)

else:
raise NoValidTrainingType(agent)
6 changes: 6 additions & 0 deletions rl_studio/agents/agents_type.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from enum import Enum


class AgentsType(Enum):
F1 = "f1"
TURTLEBOT = "turtlebot"
9 changes: 9 additions & 0 deletions rl_studio/agents/exceptions.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
class CreationError(Exception):
...


class NoValidTrainingType(CreationError):
def __init__(self, training_type):
self.traning_type = training_type
self.message = f"[ERROR] No valid training type ({training_type}) in your config.yml file or is missing."
super().__init__(self.message)
1 change: 0 additions & 1 deletion rl_studio/agents/f1/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
from rl_studio.envs.gazebo_env import *
216 changes: 0 additions & 216 deletions rl_studio/agents/f1/brains/train_qlearn.py

This file was deleted.

File renamed without changes.
Loading

0 comments on commit e2d6b24

Please sign in to comment.