Home > src > BN_pol_rec > Hsand > time.m

time

PURPOSE ^

This function returns in qulitative terms the time for enemy to reach us

SYNOPSIS ^

function [time_fuzzy] = getTime(roadPoints, positionRoad_no, enemy, our_forces, nodes, node1Node2Road_noCost, costMap)

DESCRIPTION ^

This function returns in qulitative terms the time for enemy to reach us
 It has valuse short and long. The degree of mebership is fuzzy and
1>=sum(short,long)>=0
scalefactor = is depending on type of enemy unit
type of unit [0 = airborne ; 1 = groundforce]

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 
0002 
0003 function       [time_fuzzy] = getTime(roadPoints, positionRoad_no, enemy, our_forces,  nodes, node1Node2Road_noCost, costMap) 
0004 
0005  %This function returns in qulitative terms the time for enemy to reach us
0006  % It has valuse short and long. The degree of mebership is fuzzy and
0007  %1>=sum(short,long)>=0
0008  %scalefactor = is depending on type of enemy unit
0009  %type of unit [0 = airborne ; 1 = groundforce]
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  %We create fuzzy f:on with values a,b,c
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

Generated on Wed 16-Mar-2005 09:17:47 by m2html © 2003