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

Functions to parse states and actions #33

Open
jonathan-laurent opened this issue Aug 9, 2020 · 2 comments
Open

Functions to parse states and actions #33

jonathan-laurent opened this issue Aug 9, 2020 · 2 comments

Comments

@jonathan-laurent
Copy link

Should we add functions parse_state(env, string) and parse_action(env, string) to help building interactive debugging tools?

It would be tempting to just let the user define parse_state by overloading Base.parse. However, the state is often not represented using a dedicated type and it would not make sense in those cases.

Any thoughts?

@zsunberg
Copy link
Member

Hmm... my initial thought is that Julia is simple enough that interaction should be in terms of Julia syntax rather than typing in strings, and providing this alternative will add more things to explain. It also seems like this will be very application-specific, so maybe should not be a part of the interface. An alternative would be to provide a convenience constructor or function that accepts a string representation, for example

ConnectFourState("""
| |x| |x|
| |o| |o|
|x|o|x|o|
|o|x|o|x|""") 

Of course a domain-specific solution like this means that solvers cannot use it in a generic way, so we should think about it some more.

Can you give a specific example of the debugging case you had in mind?

It would be tempting to just let the user define parse_state by overloading Base.parse. However, the state is often not represented using a dedicated type and it would not make sense in those cases.

Yes, I agree - my experience says that information from the environment would be needed for this.

@jonathan-laurent
Copy link
Author

Sorry for the late reply, I had missed your answer.

Can you give a specific example of the debugging case you had in mind?

In AlphaZero.jl, from the moment you implement the GameInterface, you can use a small console CLI to explore your agent behavior out-of-the-box. This CLI relies on function parse_state to enable the user to jump to a specific state.

But I can happily agree with you that maybe CommonRLInterface.jl is not the right place to include such functions.

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