geometries move in plots as sim runs

This commit is contained in:
2025-10-27 22:38:39 -07:00
parent ade795b3ae
commit bbefb6111b
6 changed files with 139 additions and 89 deletions

View File

@@ -1,6 +1,7 @@
function nextPos = basicGradientAscent(objectiveFunction, pos, r)
function nextPos = basicGradientAscent(objectiveFunction, domain, pos, r)
arguments (Input)
objectiveFunction (1, 1) {mustBeA(objectiveFunction, 'function_handle')};
domain (1, 1) {mustBeGeometry};
pos (1, 3) double;
r (1, 1) double;
end
@@ -39,5 +40,5 @@ function nextPos = basicGradientAscent(objectiveFunction, pos, r)
% Select next position by maximum sensed value
nextPos = neighborPos(neighborValues == max(neighborValues), :);
nextPos = nextPos(1, 1:3); % just in case two get selected, simply pick one
nextPos = [nextPos(1, 1:2), pos(3)]; % just in case two get selected, simply pick one
end