results
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -48,6 +48,7 @@ sandbox/*
|
|||||||
|
|
||||||
# Figures
|
# Figures
|
||||||
*.fig
|
*.fig
|
||||||
|
*.png
|
||||||
|
|
||||||
# Python Virtual Environment
|
# Python Virtual Environment
|
||||||
aerpaw/venv/
|
aerpaw/venv/
|
||||||
|
|||||||
8
plot_1.m
8
plot_1.m
@@ -100,7 +100,7 @@ hBar = bar(x1, C_mean);
|
|||||||
hold(x1, 'on');
|
hold(x1, 'on');
|
||||||
for jj = 1:nConfigsPerN
|
for jj = 1:nConfigsPerN
|
||||||
xPos = hBar(jj).XEndPoints;
|
xPos = hBar(jj).XEndPoints;
|
||||||
errorbar(x1, xPos, C_mean(:, jj), C_var(:, jj), 'k.', 'LineWidth', 1, 'HandleVisibility', 'off');
|
errorbar(x1, xPos, C_mean(:, jj), C_var(:, jj), 'k.', 'LineWidth', 1, 'HandleVisibility', 'off'); % disabled the error bars because they are small to the point of meaninglessness
|
||||||
end
|
end
|
||||||
hold(x1, 'off');
|
hold(x1, 'off');
|
||||||
set(x1, 'XTickLabel', string(n_unique));
|
set(x1, 'XTickLabel', string(n_unique));
|
||||||
@@ -111,6 +111,9 @@ legend(["$AI\alpha$"; "$AI\beta$"; "$AII\alpha$"; "$BI\beta$"], "Interpreter", "
|
|||||||
grid("on");
|
grid("on");
|
||||||
ylim([0, 1/2]);
|
ylim([0, 1/2]);
|
||||||
|
|
||||||
|
savefig(f1, "plot1.fig");
|
||||||
|
exportgraphics(f1, "plot1.png");
|
||||||
|
|
||||||
%%
|
%%
|
||||||
f2 = figure;
|
f2 = figure;
|
||||||
x2 = axes;
|
x2 = axes;
|
||||||
@@ -181,3 +184,6 @@ grid(x2, "on");
|
|||||||
yline(collisionRadius, 'r--', "Label", "Collision Radius", "LabelHorizontalAlignment", "left", "HandleVisibility", "off");
|
yline(collisionRadius, 'r--', "Label", "Collision Radius", "LabelHorizontalAlignment", "left", "HandleVisibility", "off");
|
||||||
yline(commsRadius, 'r--', "Label", "Communications Radius", "LabelHorizontalAlignment", "left", "HandleVisibility", "off");
|
yline(commsRadius, 'r--', "Label", "Communications Radius", "LabelHorizontalAlignment", "left", "HandleVisibility", "off");
|
||||||
ylim([0, commsRadius + 5]);
|
ylim([0, commsRadius + 5]);
|
||||||
|
|
||||||
|
savefig(f2, "plot2.fig");
|
||||||
|
exportgraphics(f2, "plot2.png");
|
||||||
43
plot_3.m
43
plot_3.m
@@ -19,10 +19,10 @@ x3 = axes;
|
|||||||
assert(size(init.objectivePos, 1) == 1)
|
assert(size(init.objectivePos, 1) == 1)
|
||||||
assert(hist.useDoubleIntegrator);
|
assert(hist.useDoubleIntegrator);
|
||||||
|
|
||||||
plot(hist.perf./init.objectiveIntegral);
|
plot(hist.perf./init.objectiveIntegral, "LineWidth", 2);
|
||||||
hold("on");
|
hold("on");
|
||||||
for ii = 1:length(hist.agent)
|
for ii = 1:length(hist.agent)
|
||||||
plot(hist.agent(ii).perf./init.objectiveIntegral);
|
plot(hist.agent(ii).perf./init.objectiveIntegral, "LineWidth", 2);
|
||||||
end
|
end
|
||||||
grid("on");
|
grid("on");
|
||||||
ylabel("Performance (normalized)");
|
ylabel("Performance (normalized)");
|
||||||
@@ -30,6 +30,9 @@ xlabel("Timestep");
|
|||||||
legend(["Cumulative"; "Agent 1"; "Agent 2"; "Agent 3"; "Agent 4"], "Location", "northwest");
|
legend(["Cumulative"; "Agent 1"; "Agent 2"; "Agent 3"; "Agent 4"], "Location", "northwest");
|
||||||
title("$AII\beta$ Performance", "Interpreter", "latex");
|
title("$AII\beta$ Performance", "Interpreter", "latex");
|
||||||
|
|
||||||
|
savefig(f3, "plot3.fig");
|
||||||
|
exportgraphics(f3, "plot3.png");
|
||||||
|
|
||||||
f4 = figure;
|
f4 = figure;
|
||||||
x4 = axes;
|
x4 = axes;
|
||||||
|
|
||||||
@@ -55,7 +58,7 @@ end
|
|||||||
hold(x4, 'on');
|
hold(x4, 'on');
|
||||||
hLeft = gobjects(nPairs, 1);
|
hLeft = gobjects(nPairs, 1);
|
||||||
for pp = 1:nPairs
|
for pp = 1:nPairs
|
||||||
hLeft(pp) = plot(x4, pairDistMat(:, pp), 'LineWidth', 1);
|
hLeft(pp) = plot(x4, pairDistMat(:, pp), 'LineWidth', 2);
|
||||||
end
|
end
|
||||||
yline(x4, collisionRadius, 'r--', "Label", "Collision Radius", "LabelHorizontalAlignment", "left", "HandleVisibility", "off");
|
yline(x4, collisionRadius, 'r--', "Label", "Collision Radius", "LabelHorizontalAlignment", "left", "HandleVisibility", "off");
|
||||||
yline(x4, commsRadius, 'r--', "Label", "Communications Radius", "LabelHorizontalAlignment", "left", "HandleVisibility", "off");
|
yline(x4, commsRadius, 'r--', "Label", "Communications Radius", "LabelHorizontalAlignment", "left", "HandleVisibility", "off");
|
||||||
@@ -75,7 +78,11 @@ for jj = 1:nAgents-1
|
|||||||
pairLabels(pp) = sprintf("Agents %d-%d Distance", jj, kk);
|
pairLabels(pp) = sprintf("Agents %d-%d Distance", jj, kk);
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
% Left legend created after right-axis plots (see below)
|
|
||||||
|
l = legend(hLeft(:), pairLabels(:), "Location", "northeast");
|
||||||
|
|
||||||
|
savefig(f4, "plot4_distanceOnly.fig");
|
||||||
|
exportgraphics(f4, "plot4_distanceOnly.png");
|
||||||
|
|
||||||
% Plot all barrier function values on right Y-axis
|
% Plot all barrier function values on right Y-axis
|
||||||
nObs = init.numObstacles;
|
nObs = init.numObstacles;
|
||||||
@@ -102,32 +109,34 @@ comStart = domStart + nAD;
|
|||||||
hRight = gobjects(0, 1);
|
hRight = gobjects(0, 1);
|
||||||
rightLabels = strings(0, 1);
|
rightLabels = strings(0, 1);
|
||||||
for pp = 1:nAA
|
for pp = 1:nAA
|
||||||
hRight(end+1) = plot(x4, hist.barriers(colStart + pp - 1, :), '--', 'LineWidth', 1, 'Color', pairColors(pp, :));
|
hRight(end+1) = plot(x4, hist.barriers(colStart + pp - 1, :), '--', 'LineWidth', 1.5, 'Color', pairColors(pp, :));
|
||||||
rightLabels(end+1) = sprintf('h_{col} %d', pp);
|
rightLabels(end+1) = sprintf('h_{col} %d', pp);
|
||||||
end
|
end
|
||||||
for pp = 1:nComms
|
for pp = 1:nComms
|
||||||
hRight(end+1) = plot(x4, hist.barriers(comStart + pp - 1, :), '-', 'LineWidth', 1.5, 'Color', pairColors(pp, :));
|
hRight(end+1) = plot(x4, hist.barriers(comStart + pp - 1, :), '-.', 'LineWidth', 1.5, 'Color', pairColors(pp, :));
|
||||||
rightLabels(end+1) = sprintf('h_{com} %d', pp);
|
rightLabels(end+1) = sprintf('h_{com} %d', pp);
|
||||||
end
|
end
|
||||||
|
|
||||||
% Obstacle barriers — colored by agent
|
% Obstacle barriers — colored by agent
|
||||||
idx = obsStart;
|
% idx = obsStart;
|
||||||
for aa = 1:nAgents
|
% for aa = 1:nAgents
|
||||||
for oo = 1:nObs
|
% for oo = 1:nObs
|
||||||
hRight(end+1) = plot(x4, hist.barriers(idx, :), ':', 'LineWidth', 1, 'Color', agentColors(aa, :));
|
% hRight(end+1) = plot(x4, hist.barriers(idx, :), ':', 'LineWidth', 1, 'Color', agentColors(aa, :));
|
||||||
rightLabels(end+1) = sprintf('h_{obs} a%d-o%d', aa, oo);
|
% rightLabels(end+1) = sprintf('h_{obs} a%d-o%d', aa, oo);
|
||||||
idx = idx + 1;
|
% idx = idx + 1;
|
||||||
end
|
% end
|
||||||
end
|
% end
|
||||||
|
|
||||||
|
|
||||||
hold(x4, 'off');
|
hold(x4, 'off');
|
||||||
ylabel(x4, "Barrier function $h$", "Interpreter", "latex");
|
ylabel(x4, "Barrier function $h$", "Interpreter", "latex");
|
||||||
|
|
||||||
% Clamp both Y-axes to start at 0
|
% Clamp both Y-axes to start at 0
|
||||||
yyaxis(x4, 'left'); ylim(x4, [0, 25]);
|
yyaxis(x4, 'left'); ylim(x4, [0, 25]);
|
||||||
yyaxis(x4, 'right'); ylim(x4, [0, inf]);
|
yyaxis(x4, 'right'); ylim(x4, [0, 275]);
|
||||||
x4.YAxis(2).Color = 'k';
|
x4.YAxis(2).Color = 'k';
|
||||||
|
|
||||||
% Combined legend
|
% Combined legend
|
||||||
legend([hLeft(:); hRight(:)], [pairLabels(:); rightLabels(:)], "Location", "eastoutside");
|
l = legend([hLeft(:); hRight(:)], [pairLabels(:); rightLabels(:)], "Location", "eastoutside");
|
||||||
|
|
||||||
|
savefig(f4, "plot4.fig");
|
||||||
|
exportgraphics(f4, "plot4.png");
|
||||||
@@ -10,8 +10,8 @@ classdef results < matlab.unittest.TestCase
|
|||||||
|
|
||||||
%% Diagnostic Parameters
|
%% Diagnostic Parameters
|
||||||
% No effect on simulation dynamics
|
% No effect on simulation dynamics
|
||||||
makeVideo = false; % disable video writing for big performance increase
|
makeVideo = true; % disable video writing for big performance increase
|
||||||
makePlots = false; % disable plotting for big performance increase (also disables video)
|
makePlots = true; % disable plotting for big performance increase (also disables video)
|
||||||
plotCommsGeometry = false; % disable plotting communications geometries
|
plotCommsGeometry = false; % disable plotting communications geometries
|
||||||
|
|
||||||
%% Scenario Reinitialization
|
%% Scenario Reinitialization
|
||||||
|
|||||||
Reference in New Issue
Block a user