JuliaPOMDP / RockSample.jl

Implement the rock sample problem using POMDPs.jl
Other
5 stars 5 forks source link

Sample Action Available also when the agent is not on rocks #25

Closed LorenzoBonanni closed 1 year ago

LorenzoBonanni commented 1 year ago

When the agent is not on a rock, it can sample, but it shouldn't be allowed. A wrong action index causes that in actions.jl at line 2.

const BASIC_ACTIONS_DICT = Dict(
                                :north => 1, 
                                :east => 2,
                                :south => 3,
                                :west => 4,
                                :sample => 5)

function POMDPs.actions(pomdp::RockSamplePOMDP{K}, s::RSState) where K
    if in(s.pos, pomdp.rocks_positions) # slow? pomdp.rock_pos is a vec 
        return actions(pomdp)
    else
        # sample not available
        return 2:N_BASIC_ACTIONS+K
    end
end

as you can see if the agent is on a rock the function returns all the actions except the north action but the comment says it should return all actions except the sample one.