0001
0002
0003 function [time_fuzzy] = getTime(roadPoints, positionRoad_no, enemy, our_forces, nodes, node1Node2Road_noCost, costMap)
0004
0005
0006
0007
0008
0009
0010
0011 [cost, path2, nodes2, positionRoad_no2, node1Node2Road_noCost2] = findShortestPath(roadPoints, positionRoad_no, [enemy 0], [our_forces 0], nodes, node1Node2Road_noCost, costMap);
0012 short = 0.5;
0013 long = 0.5;
0014 time = cost/scalefactor;
0015
0016 a = 300;
0017 b = 150;
0018 c = 85;
0019 if time > c
0020 short = 0;
0021 end;
0022 if (time > = a)&&(time < = b)
0023 short = (time - a)/(b-a);
0024 end;
0025 if (time < = a)
0026 short = (time - a)/(b-a);
0027 end;
0028 long = 1 - short;
0029 time_fuzzy = [short lang];
0030
0031
0032
0033