beginning to write parametric tests
This commit is contained in:
@@ -17,19 +17,8 @@ function obj = updateAdjacency(obj)
|
||||
A(ii, jj) = false; % comm range violation
|
||||
continue;
|
||||
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
|
||||
|
||||
obj.adjacency = A & A';
|
||||
|
||||
if any(obj.adjacency - obj.constraintAdjacencyMatrix < 0, 'all')
|
||||
warning("Eliminated network connections that were necessary");
|
||||
end
|
||||
end
|
||||
@@ -5,8 +5,15 @@ function validate(obj)
|
||||
arguments (Output)
|
||||
end
|
||||
|
||||
%% Communications Network Validators
|
||||
if max(conncomp(graph(obj.adjacency))) ~= 1
|
||||
warning("Network is not connected");
|
||||
end
|
||||
|
||||
if any(obj.adjacency - obj.constraintAdjacencyMatrix < 0, 'all')
|
||||
warning("Eliminated network connections that were necessary");
|
||||
end
|
||||
|
||||
%%
|
||||
|
||||
end
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info>
|
||||
<Category UUID="FileClassCategory">
|
||||
<Label UUID="test"/>
|
||||
</Category>
|
||||
</Info>
|
||||
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info location="parametricTestSuite.m" type="File"/>
|
||||
19
test/parametricTestSuite.m
Normal file
19
test/parametricTestSuite.m
Normal 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
|
||||
@@ -503,8 +503,7 @@ classdef test_miSim < matlab.unittest.TestCase
|
||||
tc.testClass.run();
|
||||
end
|
||||
function test_obstacle_avoidance(tc)
|
||||
% Right now this seems to prove that the communications
|
||||
% constraints are working, but the result is dissatisfying
|
||||
% Right now, the communications constraint is violated here
|
||||
|
||||
% Fixed single obstacle
|
||||
% Fixed two agents initial conditions
|
||||
|
||||
Reference in New Issue
Block a user