Closed WhiffleFish closed 1 year ago
Isn't the fix just to define
POMDPs.obsindex(pomdp::FullyObservablePOMDP{<:Any, S, A}, o::S) where {S, A} = stateindex(pomdp.mdp, o)
In fact, why are there any type parameters at all? Seems like we can just drop them in obsindex
Yeeeep it does seem unnecessary. The only reason I see to keep the state type parameter is to assert that the observation really is a valid state, preventing it from either failing silently or relying on stateindex
to catch the type error.
Yeah, we should just get rid of S
and A
. We might want to accept observations that are not of type S
, for example when S
is a StaticVector
but the user inputs a Vector
.
This is an ancient leftover from the early days of Julia where you either needed those parameters or the coders (i.e. me) did not realize you didn't need them.
fixed by #485
obindex
definition wrongly assumes that parametric type order forFullyObservablePOMDP
is{S,A,...}
when it really is{M,S,A}
. Consequently, a method error is always raised.https://github.com/JuliaPOMDP/POMDPs.jl/blob/cc15fe957d97ec1c41a2415843eebe8157670ab1/lib/POMDPTools/src/ModelTools/fully_observable_pomdp.jl#L6
https://github.com/JuliaPOMDP/POMDPs.jl/blob/cc15fe957d97ec1c41a2415843eebe8157670ab1/lib/POMDPTools/src/ModelTools/fully_observable_pomdp.jl#L17