How to represent the actions when setting the reward in GridWorld?
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I am learning to use the reinforcement learning toolbox. I try to creat a custom grid world environment. But i have some problem with how to set the Rewards . When using "GW.R" , how to represent the actions?
Like this:
GW.R(state2idx(GW,GW.CurrentState),:,state2idx(GW,GW.Actions.NE)) = -14;
GW.R(state2idx(GW,GW.CurrentState),:,'NW') = -14;
GW.R(state2idx(GW,GW.CurrentState),:,GW.Actions.SE) = -14;
GW.R(state2idx(GW,GW.CurrentState),:,GW.Actions.SW) = -14;
0 Kommentare
Antworten (1)
Poorna
am 30 Aug. 2023
Hi,
I understand that you would like to know the right syntax of representing the action while setting the reward for a transition. You could use the function action2idx to specify the action.
You could set the required reward as below:
GW.R(state2idx(GW,GW.CurrentState),:,action2idx(GW,"NW")) = -14;
Hope this helps!
0 Kommentare
Siehe auch
Kategorien
Mehr zu Language Support finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!