added agent position trail to plot
This commit is contained in:
@@ -15,6 +15,7 @@ function [obj] = run(obj)
|
||||
for ii = 1:size(obj.times, 1)
|
||||
% Display current sim time
|
||||
obj.t = obj.times(ii);
|
||||
obj.timestepIndex = ii;
|
||||
fprintf("Sim Time: %4.2f (%d/%d)\n", obj.t, ii, obj.maxIter + 1);
|
||||
|
||||
% Check if it's time for new partitions
|
||||
@@ -38,6 +39,9 @@ function [obj] = run(obj)
|
||||
|
||||
% Finished simulation for this timestep, do accounting
|
||||
|
||||
% Update agent position history array
|
||||
obj.posHist(1:size(obj.agents, 1), obj.timestepIndex + 1, 1:3) = reshape(cell2mat(cellfun(@(x) x.pos, obj.agents, 'UniformOutput', false)), size(obj.agents, 1), 1, 3);
|
||||
|
||||
% Update total performance
|
||||
obj.performance = [obj.performance, sum(cellfun(@(x) x.performance(end), obj.agents))];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user