From 9c65bf78802ba5e7d3fd87ff6309271035dd46f3 Mon Sep 17 00:00:00 2001 From: Kevin D Date: Sun, 24 May 2026 20:28:12 -0700 Subject: [PATCH] fixed multi-objective support, collected sim data on 3 new experiments --- aerpaw/config/scenario.csv | 2 +- aerpaw/config/scenario_columns.csv | 2 ++ aerpaw/config/scenario_lock.csv | 2 ++ aerpaw/config/scenario_two_around_wall.csv | 2 ++ aerpaw/config/scenario_walls.csv | 2 ++ test/parametricTestSuite.m | 12 +++++++++--- util/objectiveFunctionWrapper.m | 6 +++++- 7 files changed, 23 insertions(+), 5 deletions(-) create mode 100644 aerpaw/config/scenario_columns.csv create mode 100644 aerpaw/config/scenario_lock.csv create mode 100644 aerpaw/config/scenario_two_around_wall.csv create mode 100644 aerpaw/config/scenario_walls.csv diff --git a/aerpaw/config/scenario.csv b/aerpaw/config/scenario.csv index f155cfc..1e11351 100644 --- a/aerpaw/config/scenario.csv +++ b/aerpaw/config/scenario.csv @@ -1,2 +1,2 @@ timestep, maxIter, minAlt, discretizationStep, protectedRange, initialStepSize, barrierGain, barrierExponent, collisionRadius, comRange, alphaDist, betaDist, alphaTilt, betaTilt, domainMin, domainMax, objectivePos, objectiveVar, sensorPerformanceMinimum, initialPositions, numObstacles, obstacleMin, obstacleMax, useDoubleIntegrator, dampingCoeff, useFixedTopology -1, 100, 35.0, 0.1, 2.0, 6, 1, 1, "8.0, 8.0", "35.0, 35.0", "80.0, 80.0", "0.25, 0.25", "8.0, 8.0", "0.1, 0.1", "0.0, 0.0, 0.0", "100.0, 100.0, 100.0", "66.6, 66.6", "55, 35, 35, 55", 0.15, "15.0, 15.0, 50.0, 40.0, 15.0, 50.0", 1, "0.0, 35.0, 0.0", "50, 40.0, 60", 1, 2.0, 1 \ No newline at end of file +1, 50, 35.0, 0.1, 2.0, 6, 1, 1, "8.0, 8.0", "35.0, 35.0", "80.0, 50.0", "0.25, 1.0", "8.0, 25.0", "0.1, 0.02", "0.0, 0.0, 0.0", "100.0, 100.0, 100.0", "60.0, 80.0, 45.0, 70.0", "70, 15, 15, 20, 20, 15, 15, 70", 0.15, "10.0, 10.0, 50.0, 40.0, 15.0, 45.0", 8, "0.0, 30.0, 0.0, 42.0, 30.0, 0.0, 84.0, 30.0, 0.0, 13.0, 60.0, 0.0, 55.0, 60.0, 0.0, 0.0, 90, 0.0, 42.0, 90.0, 0.0, 84.0, 90.0, 0.0", "16.0, 40.0, 100.0, 58.0, 40.0, 100.0, 100.0, 40.0, 100.0, 29.0, 70.0, 100.0, 71.0, 70.0, 100.0, 16.0, 100.0, 100.0, 58.0, 100.0, 100.0, 100.0, 100.0, 100.0", 0, 2.0, 1 \ No newline at end of file diff --git a/aerpaw/config/scenario_columns.csv b/aerpaw/config/scenario_columns.csv new file mode 100644 index 0000000..1e11351 --- /dev/null +++ b/aerpaw/config/scenario_columns.csv @@ -0,0 +1,2 @@ +timestep, maxIter, minAlt, discretizationStep, protectedRange, initialStepSize, barrierGain, barrierExponent, collisionRadius, comRange, alphaDist, betaDist, alphaTilt, betaTilt, domainMin, domainMax, objectivePos, objectiveVar, sensorPerformanceMinimum, initialPositions, numObstacles, obstacleMin, obstacleMax, useDoubleIntegrator, dampingCoeff, useFixedTopology +1, 50, 35.0, 0.1, 2.0, 6, 1, 1, "8.0, 8.0", "35.0, 35.0", "80.0, 50.0", "0.25, 1.0", "8.0, 25.0", "0.1, 0.02", "0.0, 0.0, 0.0", "100.0, 100.0, 100.0", "60.0, 80.0, 45.0, 70.0", "70, 15, 15, 20, 20, 15, 15, 70", 0.15, "10.0, 10.0, 50.0, 40.0, 15.0, 45.0", 8, "0.0, 30.0, 0.0, 42.0, 30.0, 0.0, 84.0, 30.0, 0.0, 13.0, 60.0, 0.0, 55.0, 60.0, 0.0, 0.0, 90, 0.0, 42.0, 90.0, 0.0, 84.0, 90.0, 0.0", "16.0, 40.0, 100.0, 58.0, 40.0, 100.0, 100.0, 40.0, 100.0, 29.0, 70.0, 100.0, 71.0, 70.0, 100.0, 16.0, 100.0, 100.0, 58.0, 100.0, 100.0, 100.0, 100.0, 100.0", 0, 2.0, 1 \ No newline at end of file diff --git a/aerpaw/config/scenario_lock.csv b/aerpaw/config/scenario_lock.csv new file mode 100644 index 0000000..3dbf3b4 --- /dev/null +++ b/aerpaw/config/scenario_lock.csv @@ -0,0 +1,2 @@ +timestep, maxIter, minAlt, discretizationStep, protectedRange, initialStepSize, barrierGain, barrierExponent, collisionRadius, comRange, alphaDist, betaDist, alphaTilt, betaTilt, domainMin, domainMax, objectivePos, objectiveVar, sensorPerformanceMinimum, initialPositions, numObstacles, obstacleMin, obstacleMax, useDoubleIntegrator, dampingCoeff, useFixedTopology +1, 65, 35.0, 0.1, 2.0, 6, 1, 1, "8.0, 8.0", "35.0, 35.0", "80.0, 50.0", "0.25, 1.0", "8.0, 25.0", "0.1, 0.02", "0.0, 0.0, 0.0", "100.0, 100.0, 100.0", "30.0, 80.0", "60, 20, 20, 30", 0.15, "65.0, 15.0, 65.0, 65.0, 15.0, 45.0", 3, "0.0, 25.0, 55.0, 40.0, 10.0, 0.0, 40.0, 45.0, 60.0", "100.0, 70.0, 60.0, 45.0, 80.0, 55.0, 100.0, 50.0, 100.0", 0, 2.0, 1 \ No newline at end of file diff --git a/aerpaw/config/scenario_two_around_wall.csv b/aerpaw/config/scenario_two_around_wall.csv new file mode 100644 index 0000000..f155cfc --- /dev/null +++ b/aerpaw/config/scenario_two_around_wall.csv @@ -0,0 +1,2 @@ +timestep, maxIter, minAlt, discretizationStep, protectedRange, initialStepSize, barrierGain, barrierExponent, collisionRadius, comRange, alphaDist, betaDist, alphaTilt, betaTilt, domainMin, domainMax, objectivePos, objectiveVar, sensorPerformanceMinimum, initialPositions, numObstacles, obstacleMin, obstacleMax, useDoubleIntegrator, dampingCoeff, useFixedTopology +1, 100, 35.0, 0.1, 2.0, 6, 1, 1, "8.0, 8.0", "35.0, 35.0", "80.0, 80.0", "0.25, 0.25", "8.0, 8.0", "0.1, 0.1", "0.0, 0.0, 0.0", "100.0, 100.0, 100.0", "66.6, 66.6", "55, 35, 35, 55", 0.15, "15.0, 15.0, 50.0, 40.0, 15.0, 50.0", 1, "0.0, 35.0, 0.0", "50, 40.0, 60", 1, 2.0, 1 \ No newline at end of file diff --git a/aerpaw/config/scenario_walls.csv b/aerpaw/config/scenario_walls.csv new file mode 100644 index 0000000..1dd65d4 --- /dev/null +++ b/aerpaw/config/scenario_walls.csv @@ -0,0 +1,2 @@ +timestep, maxIter, minAlt, discretizationStep, protectedRange, initialStepSize, barrierGain, barrierExponent, collisionRadius, comRange, alphaDist, betaDist, alphaTilt, betaTilt, domainMin, domainMax, objectivePos, objectiveVar, sensorPerformanceMinimum, initialPositions, numObstacles, obstacleMin, obstacleMax, useDoubleIntegrator, dampingCoeff, useFixedTopology +1, 65, 35.0, 0.1, 2.0, 6, 1, 1, "8.0, 8.0", "35.0, 35.0", "80.0, 50.0", "0.25, 1.0", "8.0, 25.0", "0.1, 0.02", "0.0, 0.0, 0.0", "100.0, 100.0, 100.0", "30.0, 80.0", "60, 20, 20, 30", 0.15, "90.0, 10.0, 50.0, 65.0, 15.0, 45.0", 4, "0.0, 30.0, 0.0, 70.0, 30.0, 0.0, 0.0, 60.0, 0.0, 55.0, 60.0, 0.0", "50.0, 40.0, 100.0, 100.0, 40.0, 100.0, 35.0, 70.0, 100.0, 100.0, 70.0, 100.0", 0, 2.0, 1 \ No newline at end of file diff --git a/test/parametricTestSuite.m b/test/parametricTestSuite.m index 273030c..9b0739f 100644 --- a/test/parametricTestSuite.m +++ b/test/parametricTestSuite.m @@ -34,9 +34,15 @@ classdef parametricTestSuite < matlab.unittest.TestCase % Define scenario according to CSV specification tc.domain = tc.domain.initialize([params.domainMin; params.domainMax], REGION_TYPE.DOMAIN, "Domain"); - objectiveSigma = reshape(params.objectiveVar, [1 2 2]); - tc.domain.objective = tc.domain.objective.initialize(objectiveFunctionWrapper(params.objectivePos, objectiveSigma), tc.domain, params.discretizationStep, params.protectedRange, params.sensorPerformanceMinimum, params.objectivePos, objectiveSigma); - + if length(params.objectiveVar) > 4 && length(params.objectivePos) > 2 + objectiveSigma = permute(reshape(params.objectiveVar, [length(params.objectiveVar)/4 2 2]), [3 1 2]); + objectivePos = reshape(params.objectivePos, [length(params.objectivePos)/2, 2])'; + else + objectiveSigma = reshape(params.objectiveVar, [1, 2, 2]); + objectivePos = params.objectivePos; + end + tc.domain.objective = tc.domain.objective.initialize(objectiveFunctionWrapper(objectivePos, objectiveSigma), tc.domain, params.discretizationStep, params.protectedRange, params.sensorPerformanceMinimum, objectivePos, objectiveSigma); + agents = cell(size(params.initialPositions, 2) / 3, 1); for ii = 1:size(agents, 1) agents{ii} = agent; diff --git a/util/objectiveFunctionWrapper.m b/util/objectiveFunctionWrapper.m index 6846ffe..5d678ff 100644 --- a/util/objectiveFunctionWrapper.m +++ b/util/objectiveFunctionWrapper.m @@ -4,12 +4,16 @@ function f = objectiveFunctionWrapper(center, sigma) % composite objectives in particular arguments (Input) center (:, 2) double; - sigma (:, 2, 2) double = eye(2); + sigma (:, 2, 2) double = reshape(eye(2), 1, 2, 2); end arguments (Output) f (1, 1) {mustBeA(f, "function_handle")}; end + if size(sigma, 1) == 1 && size(center, 1) > 1 + sigma = repmat(sigma, size(center, 1), 1, 1); + end + assert(size(center, 1) == size(sigma, 1)); f = @(x,y) sum(cell2mat(arrayfun(@(i) mvnpdf([x(:), y(:)], center(i,:), squeeze(sigma(i, :, :))), 1:size(center,1), "UniformOutput", false)), 2); end \ No newline at end of file