This commit is contained in:
2026-01-27 21:46:40 -08:00
parent a68690a5cf
commit 03fae7077c
58 changed files with 214 additions and 213 deletions

View File

@@ -1,9 +1,9 @@
function f = firstPlotSetup(f)
arguments (Input)
f (1, 1) {mustBeA(f, 'matlab.ui.Figure')} = figure;
f (1, 1) {mustBeA(f, "matlab.ui.Figure")} = figure;
end
arguments (Output)
f (1, 1) {mustBeA(f, 'matlab.ui.Figure')};
f (1, 1) {mustBeA(f, "matlab.ui.Figure")};
end
if isempty(f.CurrentAxes)
tiledlayout(f, 5, 5, "TileSpacing", "tight", "Padding", "compact");
@@ -24,14 +24,14 @@ function f = firstPlotSetup(f)
grid(f.Children(1).Children(1), "off");
view(f.Children(1).Children(1), 0, 90);
title(f.Children(1).Children(1), "Network Graph");
set(f.Children(1).Children(1), 'XTickLabelMode', 'manual');
set(f.Children(1).Children(1), 'YTickLabelMode', 'manual');
set(f.Children(1).Children(1), 'XTickLabel', {});
set(f.Children(1).Children(1), 'YTickLabel', {});
set(f.Children(1).Children(1), 'XTick', []);
set(f.Children(1).Children(1), 'YTick', []);
set(f.Children(1).Children(1), 'XColor', 'none');
set(f.Children(1).Children(1), 'YColor', 'none');
set(f.Children(1).Children(1), "XTickLabelMode", "manual");
set(f.Children(1).Children(1), "YTickLabelMode", "manual");
set(f.Children(1).Children(1), "XTickLabel", {});
set(f.Children(1).Children(1), "YTickLabel", {});
set(f.Children(1).Children(1), "XTick", []);
set(f.Children(1).Children(1), "YTick", []);
set(f.Children(1).Children(1), "XColor", "none");
set(f.Children(1).Children(1), "YColor", "none");
% Top-down view
nexttile(22, [1, 1]);
@@ -68,11 +68,11 @@ function f = firstPlotSetup(f)
view(f.Children(1).Children(1), 0, 90);
xlabel(f.Children(1).Children(1), "X"); ylabel(f.Children(1).Children(1), "Y");
title(f.Children(1).Children(1), "Domain Partitioning");
set(f.Children(1).Children(1), 'XTickLabelMode', 'manual');
set(f.Children(1).Children(1), 'YTickLabelMode', 'manual');
set(f.Children(1).Children(1), 'XTickLabel', {});
set(f.Children(1).Children(1), 'YTickLabel', {});
set(f.Children(1).Children(1), 'XTick', []);
set(f.Children(1).Children(1), 'YTick', []);
set(f.Children(1).Children(1), "XTickLabelMode", "manual");
set(f.Children(1).Children(1), "YTickLabelMode", "manual");
set(f.Children(1).Children(1), "XTickLabel", {});
set(f.Children(1).Children(1), "YTickLabel", {});
set(f.Children(1).Children(1), "XTick", []);
set(f.Children(1).Children(1), "YTick", []);
end
end

View File

@@ -7,9 +7,9 @@ function f = objectiveFunctionWrapper(center, sigma)
sigma (2, 2) double = eye(2);
end
arguments (Output)
f (1, 1) {mustBeA(f, 'function_handle')};
f (1, 1) {mustBeA(f, "function_handle")};
end
f = @(x,y) sum(cell2mat(arrayfun(@(i) mvnpdf([x(:), y(:)], center(i,:), sigma), 1:size(center,1), 'UniformOutput', false)), 2);
f = @(x,y) sum(cell2mat(arrayfun(@(i) mvnpdf([x(:), y(:)], center(i,:), sigma), 1:size(center,1), "UniformOutput", false)), 2);
end

View File

@@ -1,6 +1,6 @@
function c = agentsCrowdObjective(objective, positions, protectedRange)
arguments (Input)
objective (1, 1) {mustBeA(objective, 'sensingObjective')};
objective (1, 1) {mustBeA(objective, "sensingObjective")};
positions (:, 3) double; % this could be expanded to handle n obstacles in 1 call
protectedRange (1, 1) double;
end

View File

@@ -1,6 +1,6 @@
function mustBeGeometry(geometry)
validGeometries = ["rectangularPrism"; "spherical"];
if isa(geometry, 'cell')
if isa(geometry, "cell")
for ii = 1:size(geometry, 1)
assert(any(arrayfun(@(x) isa(geometry{ii}, x), validGeometries)), "Geometry in index %d is not a valid geometry class", ii);
end

View File

@@ -1,6 +1,6 @@
function mustBeSensor(sensorModel)
validSensorModels = ["fixedCardinalSensor"; "sigmoidSensor";];
if isa(sensorModel, 'cell')
if isa(sensorModel, "cell")
for ii = 1:size(sensorModel, 1)
assert(any(arrayfun(@(x) isa(sensorModel{ii}, x), validSensorModels)), "Sensor in index %d is not a valid sensor class", ii);
end

View File

@@ -8,9 +8,9 @@ function c = domainContainsObstacle(domain, obstacle)
end
switch class(domain)
case 'rectangularPrism'
case "rectangularPrism"
switch class(obstacle)
case 'rectangularPrism'
case "rectangularPrism"
c = all(domain.minCorner <= obstacle.minCorner) && all(domain.maxCorner >= obstacle.maxCorner);
otherwise
error("%s not implemented for obstacles of class %s", coder.mfunctionname, class(domain));

View File

@@ -1,6 +1,6 @@
function c = obstacleCoversObjective(objective, obstacle)
arguments (Input)
objective (1, 1) {mustBeA(objective, 'sensingObjective')};
objective (1, 1) {mustBeA(objective, "sensingObjective")};
obstacle (1, 1) {mustBeGeometry}; % this could be expanded to handle n obstacles in 1 call
end
arguments (Output)

View File

@@ -1,6 +1,6 @@
function c = obstacleCrowdsObjective(objective, obstacle, protectedRange)
arguments (Input)
objective (1, 1) {mustBeA(objective, 'sensingObjective')};
objective (1, 1) {mustBeA(objective, "sensingObjective")};
obstacle (1, 1) {mustBeGeometry}; % this could be expanded to handle n obstacles in 1 call
protectedRange (1, 1) double;
end