-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathagentmovessave.m
More file actions
42 lines (31 loc) · 847 Bytes
/
Copy pathagentmovessave.m
File metadata and controls
42 lines (31 loc) · 847 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
function agentmovessave(count, count_ep, curr_state)
% make gif of agent over time
countstr = num2str(count);
underscorestr = '_';
countepstr = num2str(count_ep);
totalstr = strcat(countstr, underscorestr, countepstr);
filename = totalstr;
clifftask = zeros(1,48);
if ( mod(curr_state,4) == 0 && curr_state ~= 4 && curr_state ~= 48)
clifftask(8) = 1;
clifftask(12) = 1;
clifftask(16) = 1;
clifftask(20) = 1;
clifftask(24) = 1;
clifftask(28) = 1;
clifftask(32) = 1;
clifftask(36) = 1;
clifftask(40) = 1;
clifftask(44) = 1;
else
clifftask(curr_state) = 1;
end
clifftask = reshape(clifftask, 4, 12);
f = figure('visible', 'off');
axis tight manual
title('Agent');
image(clifftask, 'CDataMapping', 'scaled');
colorbar;
fpath = [pwd '/Agentimages'];
saveas(f,fullfile(fpath,filename), 'png');
end