POMDPs.jl icon indicating copy to clipboard operation
POMDPs.jl copied to clipboard

WIP: Add `action(policy, s)` interface to exploration policies

Open johannes-fischer opened this issue 2 years ago • 2 comments

To address https://github.com/JuliaPOMDP/POMDPs.jl/issues/497, I extended EpsGreedyPolicy by internal fields for the greedy policy and the iteration k. If this seems like a reasonable way to go, I can make similar changes to SoftmaxPolicy and edit doc strings. If not feel free to close this PR.

With this change both interfaces are supported: action(p::EpsGreedyPolicy, on_policy::Policy, k, s) action(p::EpsGreedyPolicy, s)

johannes-fischer avatar Jul 12 '23 19:07 johannes-fischer

Thanks for the contribution!

My only concern is that it goes against the "preferably only one obvious way to do it" wisdom (https://peps.python.org/pep-0020/), since now k is in multiple places.

But I think this is probably OK. I think you should go ahead and implement it for the other policies and I will merge if it looks good.

zsunberg avatar Jul 14 '23 21:07 zsunberg

Is there a name we could use besides update!? Perhaps something more specific like set_age!

zsunberg avatar Jul 14 '23 21:07 zsunberg