-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrunExperiment.m
40 lines (38 loc) · 2.02 KB
/
runExperiment.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
function [trajA, trajB, distanceTerrain, lcfMatching] = runExperiment(dataType,distanceType,chosenNorm)
[trajA, trajB] = generateArtificialData(dataType);
trajA = pad2DTrajectoryTo3D(trajA);
trajB = pad2DTrajectoryTo3D(trajB);
experimentExtension = [dataType, 'Norm', num2str(chosenNorm)];
switch distanceType
case 'normal'
distanceTerrain = matching.compute_distance_terrain(trajA,trajB,chosenNorm);
case 'directionalDistance'
distanceTerrain = matching.directionalDistanceTerrain(trajA,trajB,chosenNorm);
[trajA, trajB, distanceTerrain] = trimOffLastPoint(trajA,trajB,distanceTerrain);
experimentExtension = [experimentExtension, 'DirectionalDistance'];
case 'dynamicInteraction'
alpha = 2;
distanceTerrain = matching.dynamicInteractionTerrain(trajA,trajB,chosenNorm,alpha);
[trajA, trajB, distanceTerrain] = trimOffLastPoint(trajA,trajB,distanceTerrain);
experimentExtension = [experimentExtension, 'DynamicInteraction'];
case 'dynamicDistance'
alpha = 2;
distanceTerrain = matching.dynamicDistanceTerrain(trajA,trajB,chosenNorm,alpha);
[trajA, trajB, distanceTerrain] = trimOffLastPoint(trajA,trajB,distanceTerrain);
experimentExtension = [experimentExtension, 'DynamicDistance'];
case 'heading'
distanceTerrain = matching.headingTerrain(trajA,trajB,chosenNorm);
[trajA, trajB, distanceTerrain] = trimOffLastPoint(trajA,trajB,distanceTerrain);
experimentExtension = [experimentExtension, 'Heading'];
otherwise
error('Cannot handle this choice');
end
pathToResults = 'results/synthetic/';
matchingName = [pathToResults, 'matchingOn', experimentExtension, '.dump'];
delayPlotName = [pathToResults, 'delaySpaceOn', experimentExtension, '.png'];
lcfMatching = matching.discrete_lcfm(trajA,trajB,distanceTerrain);
matching.writeMatching(lcfMatching,matchingName);
visualise.plotMatching(lcfMatching);
delayPlot = visualise.plotMatchingInFreeSpace(distanceTerrain, lcfMatching);
saveas(delayPlot,delayPlotName);
end