040406 RS.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]
0001 0002 0003 function [time_fuzzy] = getTime(cost, enemy, friendly_force) 0004 0005 % 040406 RS.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 short = 0.5; 0012 long = 0.5; 0013 time = cost; 0014 %alt. time = cost*scalefactor 0015 %We create fuzzy f:on with critical values b,c 0016 c = 100; 0017 b = 50; 0018 if time > c 0019 short = 0; 0020 end; 0021 if (time >= b)&&(time <= c) 0022 short = (c - time)/(c-b); 0023 end; 0024 if (time < b) 0025 short = 1; 0026 end; 0027 long = 1 - short; 0028 time_fuzzy = [short long]; 0029 0030 0031 0032