beginning to write parametric tests

This commit is contained in:
2026-01-13 15:15:42 -08:00
parent ff02e8a1c6
commit df31c2f03c
6 changed files with 35 additions and 13 deletions

View File

@@ -17,19 +17,8 @@ function obj = updateAdjacency(obj)
A(ii, jj) = false; % comm range violation A(ii, jj) = false; % comm range violation
continue; continue;
end end
% % Check that agents do not have their line of sight obstructed
% for kk = 1:size(obj.obstacles, 1)
% if obj.obstacles{kk}.containsLine(obj.agents{jj}.pos, obj.agents{ii}.pos)
% A(ii, jj) = false;
% end
% end
end end
end end
obj.adjacency = A & A'; obj.adjacency = A & A';
if any(obj.adjacency - obj.constraintAdjacencyMatrix < 0, 'all')
warning("Eliminated network connections that were necessary");
end
end end

View File

@@ -5,8 +5,15 @@ function validate(obj)
arguments (Output) arguments (Output)
end end
%% Communications Network Validators
if max(conncomp(graph(obj.adjacency))) ~= 1 if max(conncomp(graph(obj.adjacency))) ~= 1
warning("Network is not connected"); warning("Network is not connected");
end end
if any(obj.adjacency - obj.constraintAdjacencyMatrix < 0, 'all')
warning("Eliminated network connections that were necessary");
end
%%
end end

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Info>
<Category UUID="FileClassCategory">
<Label UUID="test"/>
</Category>
</Info>

View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<Info location="parametricTestSuite.m" type="File"/>

View File

@@ -0,0 +1,19 @@
classdef parametricTestSuite < matlab.unittest.TestCase
methods (TestClassSetup)
% Shared setup for the entire test class
end
methods (TestMethodSetup)
% Setup for each test
end
methods (Test)
% Test methods
function unimplementedTest(testCase)
testCase.verifyFail("Unimplemented test");
end
end
end

View File

@@ -503,8 +503,7 @@ classdef test_miSim < matlab.unittest.TestCase
tc.testClass.run(); tc.testClass.run();
end end
function test_obstacle_avoidance(tc) function test_obstacle_avoidance(tc)
% Right now this seems to prove that the communications % Right now, the communications constraint is violated here
% constraints are working, but the result is dissatisfying
% Fixed single obstacle % Fixed single obstacle
% Fixed two agents initial conditions % Fixed two agents initial conditions