From 08e396c155a07259690a1ba7f775287a5ab4cde0 Mon Sep 17 00:00:00 2001 From: Kevin D Date: Tue, 13 Jan 2026 16:37:39 -0800 Subject: [PATCH] demonstrated test iteration over parameters, scales really poorly --- @agent/agent.m | 1 - test/parametricTestSuite.m | 47 ++++++++++++++++++++++++++++++-------- test/test_miSim.m | 6 ++--- 3 files changed, 40 insertions(+), 14 deletions(-) diff --git a/@agent/agent.m b/@agent/agent.m index 51a2304..aebca85 100644 --- a/@agent/agent.m +++ b/@agent/agent.m @@ -5,7 +5,6 @@ classdef agent % Sensor sensorModel; - sensingLength = 0.05; % length parameter used by sensing function % State lastPos = NaN(1, 3); % position from previous timestep diff --git a/test/parametricTestSuite.m b/test/parametricTestSuite.m index 1e6eb8e..bc56f58 100644 --- a/test/parametricTestSuite.m +++ b/test/parametricTestSuite.m @@ -1,18 +1,47 @@ classdef parametricTestSuite < matlab.unittest.TestCase + properties (Access = private) + % System under test + testClass = miSim; + domain = rectangularPrism; + objective = sensingObjective; + obstacles = cell(1, 0); - methods (TestClassSetup) - % Shared setup for the entire test class + %% Diagnostic Parameters + % No effect on simulation dynamics + timestep = 1; + makeVideo = true; % disable video writing for big performance increase + makePlots = true; % disable plotting for big performance increase (also disables video) + plotCommsGeometry = false; % disable plotting communications geometries + protectedRange = 0; + end + properties (TestParameter) + %% Simulation Parameters + maxIter = num2cell([200, 400]); % number of timesteps to run + + % Domain parameters + minAlt = num2cell([1, 3]); % minimum allowed agent altitude, make sure test cases don't conflict with this + + % Sensing Objective Parameters + discretizationStep = num2cell([0.01, 0.05]); + + % Agent Parameters + collisionRange = num2cell([0.1, 0.5]); + + % Sensor Model Parameters + betaDist = num2cell(3:6:15); + betaTilt = num2cell(3:6:15); + alphaDist = num2cell([2.5, 5]); + alphaTilt = num2cell([15, 30]); % (degrees) + + % Communications Parameters + comRange = num2cell(1:2:5); end - methods (TestMethodSetup) - % Setup for each test - end - - methods (Test) + methods (Test, ParameterCombination = "exhaustive") % Test methods - function unimplementedTest(testCase) - testCase.verifyFail("Unimplemented test"); + function single_agent_gradient_ascent(tc, maxIter, minAlt, discretizationStep, collisionRange, alphaDist, alphaTilt, betaDist, betaTilt, comRange) + 1; end end diff --git a/test/test_miSim.m b/test/test_miSim.m index d3a6a0a..ac00406 100644 --- a/test/test_miSim.m +++ b/test/test_miSim.m @@ -10,8 +10,7 @@ classdef test_miSim < matlab.unittest.TestCase % Sim maxIter = 250; - timestep = 0.05 - partitoningFreq = 5; + timestep = 0.05; % Domain domain = rectangularPrism; % domain geometry @@ -33,7 +32,6 @@ classdef test_miSim < matlab.unittest.TestCase % Agents minAgents = 3; % Minimum number of agents to be randomly generated maxAgents = 4; % Maximum number of agents to be randomly generated - sensingLength = 0.05; % length parameter used by sensing function agents = cell(0, 1); % Collision @@ -429,7 +427,7 @@ classdef test_miSim < matlab.unittest.TestCase tc.verifyEqual(unique(tc.testClass.partitioning), [0; 1]); tc.verifyLessThan(sum(tc.testClass.partitioning == 1, 'all'), sum(tc.testClass.partitioning == 0, 'all')); end - function test_single_partition_basic_GA(tc) + function test_single_agent_gradient_ascent(tc) % make basic domain l = 10; % domain size tc.domain = tc.domain.initialize([zeros(1, 3); l * ones(1, 3)], REGION_TYPE.DOMAIN, "Domain");