Reinforcement Learning: Multiple Unique Discrete Actions

6 vues (au cours des 30 derniers jours)
Huzaifah Shamim
Huzaifah Shamim le 27 Juil 2020
THis question has been answered before here, but I wanted to make a variation of this. Lets say we wanted to make the following modification. Once one action value has been selected, the second possible action value can not be the same. So if we had:
a = [1,2,3,4,5,6,7,8,9, 10];
b = [1,2,3,4,5,6,7,8,9, 10];
[A,B] = meshgrid(a,b);
actions = reshape(cat(2,A',B'),[],2);
actionInfo = num2cell(actions,2);
I basically want to get rid of the cell arrays that have the same values such as [1,1], [2,2], [3,3].....[10,10]. Is there an easy way to do this?
Clarification: But I do want to have values such as [1,2] and [2,1]

Réponse acceptée

Uday Pradhan
Uday Pradhan le 7 Sep 2020
Hi Huzaifa,
According to my understanding, you would like to remove the action pairs which have the same values like [1 1],[2 2],...[10 10]. To do this, you can create a separate action matrix which do not have such arrays at all (10 in total to be excluded).
newActions = actions(actions(:,1)~=actions(:,2),:);
actionInfo = num2cell(newActions,2);
This will give you a cell array which do not contain pairs of type [x x]. Hope this helps!

Plus de réponses (0)

Produits


Version

R2020a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by