nixed agent index property

This commit is contained in:
2026-01-01 17:02:36 -08:00
parent 06f6af1511
commit 492c5c2140
7 changed files with 29 additions and 49 deletions

View File

@@ -16,7 +16,10 @@ function obj = partition(obj)
[~, idx] = max(agentPerformances, [], 3);
% Collect agent indices in the same way as performance
agentInds = cellfun(@(x) x.index * ones(size(obj.objective.X)), obj.agents, 'UniformOutput', false);
indices = 1:size(obj.agents, 1);
agentInds = squeeze(tensorprod(indices, ones(size(obj.objective.X))));
agentInds = num2cell(agentInds, 2:3);
agentInds = cellfun(@(x) squeeze(x), agentInds, 'UniformOutput', false);
agentInds{end + 1} = zeros(size(agentInds{end})); % index for no assignment
agentInds = cat(3, agentInds{:});

View File

@@ -30,7 +30,7 @@ function [obj] = run(obj)
% Iterate over agents to simulate their unconstrained motion
for jj = 1:size(obj.agents, 1)
obj.agents{jj} = obj.agents{jj}.run(obj.domain, obj.partitioning, obj.t);
obj.agents{jj} = obj.agents{jj}.run(obj.domain, obj.partitioning, obj.t, jj);
end
% Adjust motion determined by unconstrained gradient ascent using