'
This commit is contained in:
@@ -1,14 +1,14 @@
|
||||
function obj = initialize(obj, objectiveFunction, domain, discretizationStep, protectedRange, sensorPerformanceMinimum)
|
||||
arguments (Input)
|
||||
obj (1,1) {mustBeA(obj, 'sensingObjective')};
|
||||
objectiveFunction (1, 1) {mustBeA(objectiveFunction, 'function_handle')};
|
||||
obj (1,1) {mustBeA(obj, "sensingObjective")};
|
||||
objectiveFunction (1, 1) {mustBeA(objectiveFunction, "function_handle")};
|
||||
domain (1, 1) {mustBeGeometry};
|
||||
discretizationStep (1, 1) double = 1;
|
||||
protectedRange (1, 1) double = 1;
|
||||
sensorPerformanceMinimum (1, 1) double = 1e-6;
|
||||
end
|
||||
arguments (Output)
|
||||
obj (1,1) {mustBeA(obj, 'sensingObjective')};
|
||||
obj (1,1) {mustBeA(obj, "sensingObjective")};
|
||||
end
|
||||
|
||||
obj.discretizationStep = discretizationStep;
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
function obj = initializeRandomMvnpdf(obj, domain, discretizationStep, protectedRange)
|
||||
arguments (Input)
|
||||
obj (1, 1) {mustBeA(obj, 'sensingObjective')};
|
||||
obj (1, 1) {mustBeA(obj, "sensingObjective")};
|
||||
domain (1, 1) {mustBeGeometry};
|
||||
discretizationStep (1, 1) double = 1;
|
||||
protectedRange (1, 1) double = 1;
|
||||
end
|
||||
arguments (Output)
|
||||
obj (1, 1) {mustBeA(obj, 'sensingObjective')};
|
||||
obj (1, 1) {mustBeA(obj, "sensingObjective")};
|
||||
end
|
||||
|
||||
% Set random objective position
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
function f = plot(obj, ind, f)
|
||||
arguments (Input)
|
||||
obj (1,1) {mustBeA(obj, 'sensingObjective')};
|
||||
obj (1,1) {mustBeA(obj, "sensingObjective")};
|
||||
ind (1, :) double = NaN;
|
||||
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
|
||||
|
||||
% Create axes if they don't already exist
|
||||
@@ -14,15 +14,15 @@ function f = plot(obj, ind, f)
|
||||
% Plot gradient on the "floor" of the domain
|
||||
if isnan(ind)
|
||||
hold(f.CurrentAxes, "on");
|
||||
o = surf(f.CurrentAxes, obj.X, obj.Y, zeros(size(obj.X)), obj.values ./ max(obj.values, [], "all"), 'EdgeColor', 'none');
|
||||
o.HitTest = 'off';
|
||||
o.PickableParts = 'none';
|
||||
o = surf(f.CurrentAxes, obj.X, obj.Y, zeros(size(obj.X)), obj.values ./ max(obj.values, [], "all"), "EdgeColor", "none");
|
||||
o.HitTest = "off";
|
||||
o.PickableParts = "none";
|
||||
hold(f.CurrentAxes, "off");
|
||||
else
|
||||
hold(f.Children(1).Children(ind(1)), "on");
|
||||
o = surf(f.Children(1).Children(ind(1)), obj.X, obj.Y, zeros(size(obj.X)), obj.values ./ max(obj.values, [], "all"), 'EdgeColor', 'none');
|
||||
o.HitTest = 'off';
|
||||
o.PickableParts = 'none';
|
||||
o = surf(f.Children(1).Children(ind(1)), obj.X, obj.Y, zeros(size(obj.X)), obj.values ./ max(obj.values, [], "all"), "EdgeColor", "none");
|
||||
o.HitTest = "off";
|
||||
o.PickableParts = "none";
|
||||
hold(f.Children(1).Children(ind(1)), "off");
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user