fixed lesser neighbor algorithm

This commit is contained in:
2026-01-06 10:57:56 -08:00
parent 7d1154d028
commit 4fe897455d
4 changed files with 127 additions and 24 deletions

View File

@@ -28,6 +28,8 @@ classdef agent
% Communication
comRange = NaN;
commsGeometry = spherical;
lesserNeighbors = [];
performance = 0;

View File

@@ -22,13 +22,14 @@ function obj = initialize(obj, pos, vel, pan, tilt, collisionGeometry, sensorMod
obj.tilt = tilt;
obj.collisionGeometry = collisionGeometry;
obj.sensorModel = sensorModel;
obj.comRange = comRange;
obj.guidanceModel = @gradientAscent;
obj.label = label;
obj.debug = debug;
obj.plotCommsGeometry = plotCommsGeometry;
% Add spherical geometry based on com range
obj.commsGeometry = obj.commsGeometry.initialize(obj.pos, comRange, REGION_TYPE.COMMS, sprintf("%s Comms Geometry", obj.label));
obj.commsGeometry = obj.commsGeometry.initialize(obj.pos, obj.comRange, REGION_TYPE.COMMS, sprintf("%s Comms Geometry", obj.label));
if obj.debug
obj.debugFig = figure;