# Impossible actions in POMDPs.jl

**URL:** <https://discourse.julialang.org/t/impossible-actions-in-pomdps-jl/80662>\
**Category:** New to Julia\
**Tags:** question, package\
**Created:** [May 7, 2022, 12:23pm UTC](https://discourse.julialang.org/t/impossible-actions-in-pomdps-jl/80662 "2022-05-07T12:23:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![vamp](https://avatars.discourse-cdn.com/v4/letter/v/f4b2a3/32.png) [@vamp](https://discourse.julialang.org/u/vamp)\
**Post date:** [May 7, 2022, 12:23pm UTC](https://discourse.julialang.org/t/impossible-actions-in-pomdps-jl/80662/1 "2022-05-07T12:23:57Z")

</div>

Hello,

For POMDPs.jl I have a big state space (bigger than 2.000 possible states). From certain states, I cannot take some actions, that is state-dependent actions.

I have check the documentation (link [here](https://juliapomdp.github.io/POMDPs.jl/latest/)). And for [TabularTDLearning](https://github.com/JuliaPOMDP/TabularTDLearning.jl) I guess I cannot use a function to determine all the possible actions for a state, so I gave a bad reward to impossible actions and the next state is the previous state, but as the state-space is quite big it doesn’t find the optimal policy.

Do you think it is the right way?

---

<div class="post-metadata">

**Author:** ![mkitti](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mkitti/32/12459_2.png) [@mkitti](https://discourse.julialang.org/u/mkitti)\
**Post date:** [May 14, 2022, 10:54am UTC](https://discourse.julialang.org/t/impossible-actions-in-pomdps-jl/80662/2 "2022-05-14T10:54:15Z")

</div>

Bump, and I will ping @zsunberg for you.

---

<div class="post-metadata">

**Author:** ![vamp](https://avatars.discourse-cdn.com/v4/letter/v/f4b2a3/32.png) [@vamp](https://discourse.julialang.org/u/vamp)\
**Post date:** [May 14, 2022, 11:04am UTC](https://discourse.julialang.org/t/impossible-actions-in-pomdps-jl/80662/3 "2022-05-14T11:04:47Z")

</div>

Thanks 😊

---

<div class="post-metadata">

**Author:** ![rejuvyesh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rejuvyesh/32/91_2.png) [@rejuvyesh](https://discourse.julialang.org/u/rejuvyesh)\
**Post date:** [May 14, 2022, 5:37pm UTC](https://discourse.julialang.org/t/impossible-actions-in-pomdps-jl/80662/4 "2022-05-14T17:37:34Z")

</div>

Current implementations in `TabularTDLearning` don’t support action masking and a PR would be very welcome. `ReinforcementLearning.jl` probably has better support there. POMDPs.jl (and other solvers in the ecosystem) do support state dependent legal actions; you just need to define `actions(mdp, s)` for your problem to define the legal action set for each state `s`.
