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 specify either-or requirements #3

Open
Shushman opened this issue Apr 12, 2018 · 3 comments
Open

How to specify either-or requirements #3

Shushman opened this issue Apr 12, 2018 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@Shushman
Copy link
Collaborator

We need the mdp to EITHER implement transition or generate_sr. What's the right way to do that?

@Shushman Shushman added the enhancement New feature or request label Apr 12, 2018
@Shushman Shushman self-assigned this Apr 12, 2018
@zsunberg
Copy link
Member

You should be able to something like this:

@POMDP_require solve(solver::LocalApproximationValueIterationSolver, mdp::Union{MDP,POMDP}) begin
  ...
  if solver.is_mdp_generative
    @req generate_sr(...)
  else
    @req transition(...)
    @req reward(...)
  end
  ...
end

@zsunberg
Copy link
Member

OR you could fix the "Use static analysis..." checkbox of JuliaPOMDP/POMDPs.jl#124 and it would all work automatically :)

@Shushman
Copy link
Collaborator Author

Shushman commented Apr 12, 2018

Thanks! I'll start with the first one for now and then do the second one maybe later ;)

Edit - First suggestion added in af0d50d, second for later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants