-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #35 from JdeRobot/fixture/entrypoint
Fixture/entrypoint
- Loading branch information
Showing
30 changed files
with
3,027 additions
and
390 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +0,0 @@ | ||
from rl_studio.envs.gazebo_env import * | ||
This file was deleted.
Oops, something went wrong.
File renamed without changes.
Oops, something went wrong.