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

@@ -9,9 +9,9 @@ function obj = plotConnections(obj)
% Iterate over lower triangle off-diagonal region of the
% adjacency matrix to plot communications links between agents
X = []; Y = []; Z = [];
for ii = 2:size(obj.adjacency, 1)
for ii = 2:size(obj.constraintAdjacencyMatrix, 1)
for jj = 1:(ii - 1)
if obj.adjacency(ii, jj)
if obj.constraintAdjacencyMatrix(ii, jj)
X = [X; obj.agents{ii}.pos(1), obj.agents{jj}.pos(1)];
Y = [Y; obj.agents{ii}.pos(2), obj.agents{jj}.pos(2)];
Z = [Z; obj.agents{ii}.pos(3), obj.agents{jj}.pos(3)];