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,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