0001
0002
0003 function [C] = getCostMatrix(node1Node2Road_noCost, nodes)
0004
0005
0006
0007
0008
0009
0010
0011 C = 10000.*ones(length(nodes(:,1)), length(nodes(:,1)));
0012 for i = 1:length(nodes(:,1))
0013 C(i,i) = 0;
0014 for j = 1:length(node1Node2Road_noCost(:,1))
0015 if (nodes(i,1) == node1Node2Road_noCost(j,1))&&(nodes(i,2) == node1Node2Road_noCost(j,2))
0016 [idx] = findNodeIndex(node1Node2Road_noCost(j,3), node1Node2Road_noCost(j,4), nodes);
0017 C(i,idx) = node1Node2Road_noCost(j,6);
0018 C(idx, i) = node1Node2Road_noCost(j,6);
0019 end;
0020 end;
0021 end;
0022
0023
0024
0025