Added lesser neighbor algorithm and constraints

This commit is contained in:
2025-12-31 19:19:36 -08:00
parent fa8da50db1
commit d6a9c4ac06
10 changed files with 80 additions and 17 deletions

View File

@@ -24,7 +24,10 @@ function [obj] = run(obj)
obj = obj.partition();
end
% Iterate over agents to simulate their motion
% Determine desired communications links
obj = obj.lesserNeighbor();
% 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);
end
@@ -33,6 +36,8 @@ function [obj] = run(obj)
% CBF constraints solved by QP
obj = constrainMotion(obj);
% Finished simulation for this timestep, do accounting
% Update total performance
obj.performance = [obj.performance, sum(cellfun(@(x) x.performance(end), obj.agents))];