Skip to content

Commit

Permalink
Finished file
Browse files Browse the repository at this point in the history
The only thing left is the iteration comparing Qvalues
  • Loading branch information
sofiacha authored Oct 15, 2017
1 parent a8cba91 commit 4b19303
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions blockworldQlearning.m
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
% 8,1,5,-1,1];

Q = zeros(100,3);
policy=zeros(22,1);
lamda = ones(65,4);
temp=zeros(9,5);
c=1;
Expand All @@ -76,9 +77,8 @@
cccc=0;
fl=0;
flfl=0;

fla=0;
for u = 1:1000
for u = 1:10000
sstart=5;
while sstart~=8
for i=1:65
Expand Down Expand Up @@ -226,3 +226,19 @@
end
end

for i=1:22
c=0;
for k=1:65
if Q(k,1)==i &&c ==0
policy(i,1)=Q(k,2);
max=Q(k,3);
elseif Q(k,1)==i && c >0
if max<Q(k,3)
policy(i,1)=Q(k,2);
max=Q(k,3);
end
end
end
end


0 comments on commit 4b19303

Please sign in to comment.