Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

How to define path_save in grid2op.make? #52

Closed
jhmenke opened this issue Mar 31, 2020 · 2 comments
Closed

How to define path_save in grid2op.make? #52

jhmenke opened this issue Mar 31, 2020 · 2 comments

Comments

@jhmenke
Copy link

jhmenke commented Mar 31, 2020

I am using the grid2op.make function to generator a runner with an environment. How is it possible to define the path where the logs are saved in this function?

@BDonnot
Copy link
Collaborator

BDonnot commented Mar 31, 2020

Hello

As explained in the notebook 0 (last few cells) you can do it this way:

import grid2op
from grid2op.Runner import Runner
env = grid2op.make()
runner = Runner(**env.get_params_for_runner())

Once your runner is initialized, you can use it to compute any number of scenarios that you want, with what is explained in notebook 4:

res = runner.run(path_save="THE\PATH\HERE",
    nb_episode=2,   # number of episode to run, any positive integer
    max_iter=100  # maximum number of steps per episode, any positive integer
)

Sorry if the stuff are not properly organized

Benjamin

@jhmenke
Copy link
Author

jhmenke commented Apr 1, 2020

Thanks. It works like this:

env = grid2op.make(...)
runner = Runner(**env.get_params_for_runner(), agentClass=customAgent)
res = runner.run(path_save="customAgentLogs", nb_episode=1, max_iter=1000, pbar=True)

Maybe such a working example could be included in the documentation? That's where i looked.

@jhmenke jhmenke closed this as completed Apr 1, 2020
BDonnot added a commit that referenced this issue May 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants