From 6632c9885d829c1c457254d574bdc3975b0fe5ec Mon Sep 17 00:00:00 2001 From: krdee1 Date: Tue, 23 Dec 2025 12:13:15 -0800 Subject: [PATCH] fixed minimum agent altitude initial condition --- test/test_miSim.m | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/test_miSim.m b/test/test_miSim.m index 4ba39d0..7420ab8 100644 --- a/test/test_miSim.m +++ b/test/test_miSim.m @@ -14,7 +14,7 @@ classdef test_miSim < matlab.unittest.TestCase % Domain domain = rectangularPrism; % domain geometry minDimension = 10; - minAlt = 2; % minimum allowed agent altitude + minAlt = 1; % minimum allowed agent altitude % Obstacles minNumObstacles = 1; % Minimum number of obstacles to be randomly generated @@ -109,11 +109,11 @@ classdef test_miSim < matlab.unittest.TestCase if ii == 1 while agentsCrowdObjective(tc.domain.objective, candidatePos, mean(tc.domain.dimensions) / 2) candidatePos = tc.domain.random(); - candidatePos(3) = 1 + rand * 3; % place agents at decent altitudes for sensing + candidatePos(3) = tc.minAlt + rand * 3; % place agents at decent altitudes for sensing end else candidatePos = tc.agents{randi(ii - 1)}.pos + sign(randn([1, 3])) .* (rand(1, 3) .* tc.comRange/sqrt(2)); - candidatePos(3) = 1 + rand * 3; % place agents at decent altitudes for sensing + candidatePos(3) = tc.minAlt + rand * 3; % place agents at decent altitudes for sensing end % Make sure that the candidate position is within the @@ -241,11 +241,11 @@ classdef test_miSim < matlab.unittest.TestCase if ii == 1 while agentsCrowdObjective(tc.domain.objective, candidatePos, mean(tc.domain.dimensions) / 2) candidatePos = tc.domain.random(); - candidatePos(3) = min([tc.domain.maxCorner(3) * 0.95, 0.5 + rand * (tc.alphaDistMax * (1.1) - 0.5)]); % place agents at decent altitudes for sensing + candidatePos(3) = min([tc.domain.maxCorner(3) * 0.95, tc.minAlt + rand * (tc.alphaDistMax * (1.1) - 0.5)]); % place agents at decent altitudes for sensing end else candidatePos = tc.agents{randi(ii - 1)}.pos + sign(randn([1, 3])) .* (rand(1, 3) .* tc.comRange/sqrt(2)); - candidatePos(3) = min([tc.domain.maxCorner(3) * 0.95, 0.5 + rand * (tc.alphaDistMax * (1.1) - 0.5)]); % place agents at decent altitudes for sensing + candidatePos(3) = min([tc.domain.maxCorner(3) * 0.95, tc.minAlt + rand * (tc.alphaDistMax * (1.1) - 0.5)]); % place agents at decent altitudes for sensing end % Make sure that the candidate position is within the