reorganized code into separate files

This commit is contained in:
2025-11-15 14:36:10 -08:00
parent 4363914215
commit e0f365b21b
203 changed files with 1413 additions and 1101 deletions

View File

@@ -0,0 +1,21 @@
function [values, positions] = sense(obj, agent, sensingObjective, domain, partitioning)
arguments (Input)
obj (1, 1) {mustBeA(obj, 'sigmoidSensor')};
agent (1, 1) {mustBeA(agent, 'agent')};
sensingObjective (1, 1) {mustBeA(sensingObjective, 'sensingObjective')};
domain (1, 1) {mustBeGeometry};
partitioning (:, :) double;
end
arguments (Output)
values (:, 1) double;
positions (:, 3) double;
end
% Find positions for this agent's assigned partition in the domain
idx = partitioning == agent.index;
positions = [sensingObjective.X(idx), sensingObjective.Y(idx), zeros(size(sensingObjective.X(idx)))];
% Evaluate objective function at every point in this agent's
% assigned partiton
values = sensingObjective.values(idx);
end