JuliaPOMDP / ParticleFilters.jl

Simple particle filter implementation in Julia - works with POMDPs.jl models or others.
Other
45 stars 16 forks source link

Improve the implementation #48

Closed Wu-Chenyang closed 2 years ago

Wu-Chenyang commented 3 years ago

I suggest using the follwing codes to replace those in policies.jl. This will significantly improve the performance of AlphaVectorPolicy.

function unnormalized_util(p::AlphaVectorPolicy, b::AbstractParticleBelief)
    util = zeros(length(alphavectors(p)))
    for (i, s) in enumerate(particles(b))
        util .+= weight(b, i) .* getindex.(p.alphas, stateindex(p.pomdp, s))
    end
    return util
end
zsunberg commented 3 years ago

Hi Wu-Chenyang, Thanks for the suggestion! Can you submit a Pull Request?

Wu-Chenyang commented 3 years ago

Yes. I will submit a Pull Request tomorrow.

lassepe commented 2 years ago

Resolved by #49