diff --git a/plot_1.m b/plots_1_2.m similarity index 100% rename from plot_1.m rename to plots_1_2.m diff --git a/plot_3.m b/plots_3_4.m similarity index 100% rename from plot_3.m rename to plots_3_4.m diff --git a/resources/project/qaw0eS1zuuY1ar9TdPn1GMfrjbQ/Dt-U7DFYhio-3hILJY9YWPnda6sp.xml b/resources/project/qaw0eS1zuuY1ar9TdPn1GMfrjbQ/Dt-U7DFYhio-3hILJY9YWPnda6sp.xml deleted file mode 100644 index ad26ca2..0000000 --- a/resources/project/qaw0eS1zuuY1ar9TdPn1GMfrjbQ/Dt-U7DFYhio-3hILJY9YWPnda6sp.xml +++ /dev/null @@ -1,2 +0,0 @@ - - \ No newline at end of file diff --git a/resources/project/qaw0eS1zuuY1ar9TdPn1GMfrjbQ/Dt-U7DFYhio-3hILJY9YWPnda6sd.xml b/resources/project/qaw0eS1zuuY1ar9TdPn1GMfrjbQ/FAIFc6EGkYrae07xGB2jWoFdM-0d.xml similarity index 100% rename from resources/project/qaw0eS1zuuY1ar9TdPn1GMfrjbQ/Dt-U7DFYhio-3hILJY9YWPnda6sd.xml rename to resources/project/qaw0eS1zuuY1ar9TdPn1GMfrjbQ/FAIFc6EGkYrae07xGB2jWoFdM-0d.xml diff --git a/resources/project/qaw0eS1zuuY1ar9TdPn1GMfrjbQ/FAIFc6EGkYrae07xGB2jWoFdM-0p.xml b/resources/project/qaw0eS1zuuY1ar9TdPn1GMfrjbQ/FAIFc6EGkYrae07xGB2jWoFdM-0p.xml new file mode 100644 index 0000000..64db7da --- /dev/null +++ b/resources/project/qaw0eS1zuuY1ar9TdPn1GMfrjbQ/FAIFc6EGkYrae07xGB2jWoFdM-0p.xml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/resources/project/qaw0eS1zuuY1ar9TdPn1GMfrjbQ/e-EiR3xDuOjis31Xf2_ZV1uoriEd.xml b/resources/project/qaw0eS1zuuY1ar9TdPn1GMfrjbQ/cQhJ0S-hbiRJRVZSMGQe9M3c01Yd.xml similarity index 100% rename from resources/project/qaw0eS1zuuY1ar9TdPn1GMfrjbQ/e-EiR3xDuOjis31Xf2_ZV1uoriEd.xml rename to resources/project/qaw0eS1zuuY1ar9TdPn1GMfrjbQ/cQhJ0S-hbiRJRVZSMGQe9M3c01Yd.xml diff --git a/resources/project/qaw0eS1zuuY1ar9TdPn1GMfrjbQ/cQhJ0S-hbiRJRVZSMGQe9M3c01Yp.xml b/resources/project/qaw0eS1zuuY1ar9TdPn1GMfrjbQ/cQhJ0S-hbiRJRVZSMGQe9M3c01Yp.xml new file mode 100644 index 0000000..94a4d20 --- /dev/null +++ b/resources/project/qaw0eS1zuuY1ar9TdPn1GMfrjbQ/cQhJ0S-hbiRJRVZSMGQe9M3c01Yp.xml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/resources/project/qaw0eS1zuuY1ar9TdPn1GMfrjbQ/e-EiR3xDuOjis31Xf2_ZV1uoriEp.xml b/resources/project/qaw0eS1zuuY1ar9TdPn1GMfrjbQ/e-EiR3xDuOjis31Xf2_ZV1uoriEp.xml deleted file mode 100644 index 6c72faf..0000000 --- a/resources/project/qaw0eS1zuuY1ar9TdPn1GMfrjbQ/e-EiR3xDuOjis31Xf2_ZV1uoriEp.xml +++ /dev/null @@ -1,2 +0,0 @@ - - \ No newline at end of file diff --git a/test/results.m b/test/results.m index 6555fbc..a379de7 100644 --- a/test/results.m +++ b/test/results.m @@ -269,57 +269,57 @@ classdef results < matlab.unittest.TestCase tc.testClass = tc.testClass.teardown(); close all; end - % function AIIbeta_plots_3_4(tc) - % % test-specific parameters - % tc.makePlots = true; - % tc.makeVideo = true; - % maxIters = 400; - % - % configs = results.makeConfigs(); - % c = configs.A_2_alpha; - % c.doubleIntegrator = true; % make a2alpha into a2beta - % - % % Set up fixed-size domain - % minAlt = tc.domainSize(3)/10 + rand * 1/10 * tc.domainSize(3); - % tc.testClass.domain = tc.testClass.domain.initialize([zeros(1, 3); tc.domainSize], REGION_TYPE.DOMAIN, "Domain"); - % - % % Set objective - % objectiveMu = [tc.domainSize(1) * 2 / 3, tc.domainSize(2) * 3 / 4]; - % objectiveSigma = reshape([215, 100; 100, 175], [1, 2, 2]); - % tc.testClass.domain.objective = tc.testClass.domain.objective.initialize(objectiveFunctionWrapper(objectiveMu, objectiveSigma), tc.testClass.domain, tc.discretizationStep, tc.protectedRange, tc.sensorPerformanceMinimum, objectiveMu, objectiveSigma); - % - % % Set agent initial states (fully connected network of 4) - % centerPos = [tc.domainSize(1) / 4, tc.domainSize(2) / 4]; - % d = tc.collisionRadius + (tc.comRange - tc.collisionRadius) / 4; - % agentsPos = centerPos + [1, 1; 1, -1; -1, -1; -1, 1] / sqrt(2) * d; - % agentAlt = minAlt * 1.5; - % agentsPos = [agentsPos, agentAlt * ones(4, 1) + rand * 5 - 2.5]; - % - % agents = {agent, agent, agent, agent}; - % cg = spherical; - % sensorModel = sigmoidSensor; - % sensorModel = sensorModel.initialize(c.sensor.alphaDist, c.sensor.betaDist, c.sensor.alphaTilt, c.sensor.betaTilt); - % agents{1} = agents{1}.initialize(agentsPos(1, :), cg.initialize(agentsPos(1, :), tc.collisionRadius, REGION_TYPE.COLLISION, "Agent 1 Collision Geometry"), sensorModel, tc.comRange, maxIters, tc.initialStepSize, "Agent 1", false); - % agents{2} = agents{2}.initialize(agentsPos(2, :), cg.initialize(agentsPos(2, :), tc.collisionRadius, REGION_TYPE.COLLISION, "Agent 2 Collision Geometry"), sensorModel, tc.comRange, maxIters, tc.initialStepSize, "Agent 2", false); - % agents{3} = agents{3}.initialize(agentsPos(3, :), cg.initialize(agentsPos(3, :), tc.collisionRadius, REGION_TYPE.COLLISION, "Agent 3 Collision Geometry"), sensorModel, tc.comRange, maxIters, tc.initialStepSize, "Agent 3", false); - % agents{4} = agents{4}.initialize(agentsPos(4, :), cg.initialize(agentsPos(4, :), tc.collisionRadius, REGION_TYPE.COLLISION, "Agent 4 Collision Geometry"), sensorModel, tc.comRange, maxIters, tc.initialStepSize, "Agent 4", false); - % - % obstacles = cell(1, 1); - % obstacles{1} = rectangularPrism; - % obstacles{1} = obstacles{1}.initialize([0, tc.domainSize(2)/2, 0; tc.domainSize(1) * 0.4, tc.domainSize(2), 40],REGION_TYPE.OBSTACLE, "Obstacle 1"); - % - % % Set up simulation - % tc.testClass = tc.testClass.initialize(tc.testClass.domain, agents, tc.barrierGain, tc.barrierExponent, minAlt, tc.timestep, maxIters, obstacles, tc.makePlots, tc.makeVideo, c.doubleIntegrator, tc.dampingCoeff, tc.useFixedTopology); - % - % % Save simulation parameters to output file - % tc.testClass.writeInits(); - % - % % Run - % tc.testClass = tc.testClass.run(); - % - % % Cleanup - % tc.testClass = tc.testClass.teardown(); - % end + function AIIbeta_plots_3_4(tc) + % test-specific parameters + tc.makePlots = false; + tc.makeVideo = false; + maxIters = 400; + + configs = results.makeConfigs(); + c = configs.A_2_alpha; + c.doubleIntegrator = true; % make a2alpha into a2beta + + % Set up fixed-size domain + minAlt = tc.domainSize(3)/10 + rand * 1/10 * tc.domainSize(3); + tc.testClass.domain = tc.testClass.domain.initialize([zeros(1, 3); tc.domainSize], REGION_TYPE.DOMAIN, "Domain"); + + % Set objective + objectiveMu = [tc.domainSize(1) * 2 / 3, tc.domainSize(2) * 3 / 4]; + objectiveSigma = reshape([215, 100; 100, 175], [1, 2, 2]); + tc.testClass.domain.objective = tc.testClass.domain.objective.initialize(objectiveFunctionWrapper(objectiveMu, objectiveSigma), tc.testClass.domain, tc.discretizationStep, tc.protectedRange, tc.sensorPerformanceMinimum, objectiveMu, objectiveSigma); + + % Set agent initial states (fully connected network of 4) + centerPos = [tc.domainSize(1) / 4, tc.domainSize(2) / 4]; + d = tc.collisionRadius + (tc.comRange - tc.collisionRadius) / 4; + agentsPos = centerPos + [1, 1; 1, -1; -1, -1; -1, 1] / sqrt(2) * d; + agentAlt = minAlt * 1.5; + agentsPos = [agentsPos, agentAlt * ones(4, 1) + rand * 5 - 2.5]; + + agents = {agent, agent, agent, agent}; + cg = spherical; + sensorModel = sigmoidSensor; + sensorModel = sensorModel.initialize(c.sensor.alphaDist, c.sensor.betaDist, c.sensor.alphaTilt, c.sensor.betaTilt); + agents{1} = agents{1}.initialize(agentsPos(1, :), cg.initialize(agentsPos(1, :), tc.collisionRadius, REGION_TYPE.COLLISION, "Agent 1 Collision Geometry"), sensorModel, tc.comRange, maxIters, tc.initialStepSize, "Agent 1", false); + agents{2} = agents{2}.initialize(agentsPos(2, :), cg.initialize(agentsPos(2, :), tc.collisionRadius, REGION_TYPE.COLLISION, "Agent 2 Collision Geometry"), sensorModel, tc.comRange, maxIters, tc.initialStepSize, "Agent 2", false); + agents{3} = agents{3}.initialize(agentsPos(3, :), cg.initialize(agentsPos(3, :), tc.collisionRadius, REGION_TYPE.COLLISION, "Agent 3 Collision Geometry"), sensorModel, tc.comRange, maxIters, tc.initialStepSize, "Agent 3", false); + agents{4} = agents{4}.initialize(agentsPos(4, :), cg.initialize(agentsPos(4, :), tc.collisionRadius, REGION_TYPE.COLLISION, "Agent 4 Collision Geometry"), sensorModel, tc.comRange, maxIters, tc.initialStepSize, "Agent 4", false); + + obstacles = cell(1, 1); + obstacles{1} = rectangularPrism; + obstacles{1} = obstacles{1}.initialize([0, tc.domainSize(2)/2, 0; tc.domainSize(1) * 0.4, tc.domainSize(2), 40],REGION_TYPE.OBSTACLE, "Obstacle 1"); + + % Set up simulation + tc.testClass = tc.testClass.initialize(tc.testClass.domain, agents, tc.barrierGain, tc.barrierExponent, minAlt, tc.timestep, maxIters, obstacles, tc.makePlots, tc.makeVideo, c.doubleIntegrator, tc.dampingCoeff, tc.useFixedTopology); + + % Save simulation parameters to output file + tc.testClass.writeInits(); + + % Run + tc.testClass = tc.testClass.run(); + + % Cleanup + tc.testClass = tc.testClass.teardown(); + end end methods