action space dependent on state function #354
-
So I have several continuous variables which affect whether or not certain actions are available. I have 15 discrete actions. Below is my action state dependent function which I believe is the problem as I get the error 'ERROR: MethodError: no method matching actions(::firmgame)' and everything worked prior to trying to implement this new function. My thought was to assign my actions as nothing until they meet certain state requirements, however I don't think I implemented it right. The return statement is meant to rid the vector of actions who are still labeled as nothing. If anyone could help that would be greatly appreciated! action function:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
Hello @danortega2014, I suspect that you are using a solver that does not support state-dependent actions and thus internally calls Beyond that, there is a small error in your implementation: the expression @zsunberg given that this question has popped up a couple of times, it may be a good idea to add a column to the table in the README or the docs that shows which solver supports this. Currently, the only way to find that out seems to be by looking at the code. |
Beta Was this translation helpful? Give feedback.
Hello @danortega2014,
I suspect that you are using a solver that does not support state-dependent actions and thus internally calls
POMDPs.action(m)
. Unfortunately, not all solvers support state dependent actions: e.g. DiscreteValueIteration.jl wouldn't work, while MCTS.jl and related solvers should work.Beyond that, there is a small error in your implementation: the expression
return (x->x!=nothing, m)
returns a tuple of a function and the array of actions. If you want to filter the list of actions by the function you can usefilter(!isnothing, m)
instead.@zsunberg given that this question has popped up a couple of times, it may be a good idea to add a column to the table in the READM…