JuliaPOMDP / GenerativeModels.jl

Extension to POMDPs.jl for problems with a generative model (eliminates the need for distributions)
Other
7 stars 2 forks source link

Separate generate functions for different combinations of return values #3

Closed zsunberg closed 8 years ago

zsunberg commented 8 years ago

I just merged in these changes (in PR #1 ) but wanted to still let anyone comment if they have anything to say. Before merging this change, there was only one generate() function.

If anyone is watching this (especially @ebalaban ) I'd appreciate any feedback. I think I am going to switch this interface from having a single generate() function to having a generate_ function for each combination of return values. For example generate_s() would return only a state, while generate_sor() returns a state observation reward tuple.

There are two reasons for this

  1. It was weird for generate(::POMDP, ...) to return (s', o, r) and generate(::MDP, ...) to return only (s', r)
  2. I think this will actually be clearer and more flexible (for example, a solver might just need s and r rather than s, o, and r for a POMDP) for everyone, and it might even be simpler (for example, it seems simpler to just implement generate_s() and reward() for a problem than generate that returns a tuple).

Does this seem reasonable? Does anyone see any potential consequences/difficulties that I missed?