fixed performance plot after 50th timestep

This commit is contained in:
kdee committed 2025-12-01 22:59:35 -08:00
1 parent bdd018e566
commit d30fd9ccaa
2 files changed
+15 -17

No files matched your search

+5 -2
View File
@@ -15,14 +15,17 @@ function obj = plotPerformance(obj)
% Plot current cumulative performance
hold(obj.fPerf.Children(1), 'on');
o = plot(obj.fPerf.Children(1), obj.perf(end, :));
o.XData = NaN(size(o.XData)); % correct time will be set at runtime
warning('off', 'MATLAB:gui:array:InvalidArrayShape'); % suppress this warning to avoid polluting output
o.XData = NaN(1, obj.maxIter); % correct time will be set at runtime
o.YData = [0, NaN(1, obj.maxIter - 1)];
hold(obj.fPerf.Children(1), 'off');
% Plot current agent performance
for ii = 1:(size(obj.perf, 1) - 1)
hold(obj.fPerf.Children(1), 'on');
o = [o; plot(obj.fPerf.Children(1), obj.perf(ii, :))];
o(end).XData = NaN(size(o(end).XData)); % correct time will be set at runtime
o(end).XData = NaN(1, obj.maxIter); % correct time will be set at runtime
o(end).YData = [0, NaN(1, obj.maxIter - 1)];
hold(obj.fPerf.Children(1), 'off');
end