BEGIN { FS=OFS="," Method = "COC81" # set to COC81 or COCII Style = "precise" # set to precise or round } NR == 1 { #Set up arrays for conversion of values if (Method == "COC81") { #Cocomo 81 precise data for the very low rating... EM["acap", "vl"] = 1.46; EM["pcap", "vl"] = 1.42; EM["aexp", "vl"] = 1.29; EM["modp", "vl"] = 1.20; EM["tool", "vl"] = 1.24; EM["vexp", "vl"] = 1.21; EM["lexp", "vl"] = 1.14; EM["sced", "vl"] = 1.23; EM["rely", "vl"] = 0.75; EM["cplx", "vl"] = 0.70; #Cocomo 81 precise data for the low rating... EM["acap", "l"] = 1.19; EM["pcap", "l"] = 1.17; EM["aexp", "l"] = 1.13; EM["modp", "l"] = 1.10; EM["tool", "l"] = 1.10; EM["vexp", "l"] = 1.10; EM["lexp", "l"] = 1.07; EM["sced", "l"] = 1.08; EM["data", "l"] = 0.94; EM["turn", "l"] = 0.87; EM["virt", "l"] = 0.87; EM["rely", "l"] = 0.88; EM["cplx", "l"] = 0.85; #Cocomo 81 precise data for the nominal rating... EM["acap", "n"] = 1.00; EM["pcap", "n"] = 1.00; EM["aexp", "n"] = 1.00; EM["modp", "n"] = 1.00; EM["tool", "n"] = 1.00; EM["vexp", "n"] = 1.00; EM["lexp", "n"] = 1.00; EM["sced", "n"] = 1.00; EM["data", "n"] = 1.00; EM["turn", "n"] = 1.00; EM["virt", "n"] = 1.00; EM["stor", "n"] = 1.00; EM["time", "n"] = 1.00; EM["rely", "n"] = 1.00; EM["cplx", "n"] = 1.00; #Cocomo 81 precise data for the high rating... EM["acap", "h"] = 0.86; EM["pcap", "h"] = 0.86; EM["aexp", "h"] = 0.91; EM["modp", "h"] = 0.91; EM["tool", "h"] = 0.91; EM["vexp", "h"] = 0.90; EM["lexp", "h"] = 0.95; EM["sced", "h"] = 1.04; EM["data", "h"] = 1.08; EM["turn", "h"] = 1.07; EM["virt", "h"] = 1.15; EM["stor", "h"] = 1.06; EM["time", "h"] = 1.11; EM["rely", "h"] = 1.15; EM["cplx", "h"] = 1.15; #Cocomo 81 precise data for the very high rating... EM["acap", "vh"] = 0.71; EM["pcap", "vh"] = 0.70; EM["aexp", "vh"] = 0.82; EM["modp", "vh"] = 0.82; EM["tool", "vh"] = 0.83; EM["sced", "vh"] = 1.10; EM["data", "vh"] = 1.16; EM["turn", "vh"] = 1.15; EM["virt", "vh"] = 1.30; EM["stor", "vh"] = 1.21; EM["time", "vh"] = 1.30; EM["rely", "vh"] = 1.40; EM["cplx", "vh"] = 1.30; #Cocomo 81 precise data for the extra high rating... EM["stor", "xh"] = 1.56; EM["time", "xh"] = 1.66; EM["cplx", "xh"] = 1.65; } else if (Method == "COCII") { #Cocomo II precise data for the very low rating... EM["prec", "vl"] = 6.20; EM["flex", "vl"] = 5.07; EM["resl", "vl"] = 7.07; EM["team", "vl"] = 5.48; EM["pmat", "vl"] = 7.80; EM["acap", "vl"] = 1.42; EM["pcap", "vl"] = 1.34; EM["pcon", "vl"] = 1.29; EM["aexp", "vl"] = 1.22; EM["pexp", "vl"] = 1.19; EM["ltex", "vl"] = 1.20; EM["tool", "vl"] = 1.17; EM["site", "vl"] = 1.22; EM["sced", "vl"] = 1.43; EM["rely", "vl"] = 0.82; EM["cplx", "vl"] = 0.73; EM["docu", "vl"] = 0.81; #Cocomo II precise data for the low rating... EM["prec", "l"] = 4.96; EM["flex", "l"] = 4.05; EM["resl", "l"] = 5.65; EM["team", "l"] = 4.38; EM["pmat", "l"] = 6.24; EM["acap", "l"] = 1.19; EM["pcap", "l"] = 1.15; EM["pcon", "l"] = 1.12; EM["aexp", "l"] = 1.10; EM["pexp", "l"] = 1.09; EM["ltex", "l"] = 1.09; EM["tool", "l"] = 1.09; EM["site", "l"] = 1.09; EM["sced", "l"] = 1.14; EM["rely", "l"] = 0.92; EM["data", "l"] = 0.90; EM["cplx", "l"] = 0.87; EM["ruse", "l"] = 0.95; EM["docu", "l"] = 0.91; EM["pvol", "l"] = 0.87; #Cocomo II precise data for the nominal rating... EM["prec", "n"] = 3.72; EM["flex", "n"] = 3.04; EM["resl", "n"] = 4.24; EM["team", "n"] = 3.29; EM["pmat", "n"] = 4.68; EM["acap", "n"] = 1.00; EM["pcap", "n"] = 1.00; EM["pcon", "n"] = 1.00; EM["aexp", "n"] = 1.00; EM["pexp", "n"] = 1.00; EM["ltex", "n"] = 1.00; EM["tool", "n"] = 1.00; EM["site", "n"] = 1.00; EM["sced", "n"] = 1.00; EM["rely", "n"] = 1.00; EM["data", "n"] = 1.00; EM["cplx", "n"] = 1.00; EM["ruse", "n"] = 1.00; EM["docu", "n"] = 1.00; EM["time", "n"] = 1.00; EM["stor", "n"] = 1.00; EM["pvol", "n"] = 1.00; #Cocomo II precise data for the high rating... EM["prec", "h"] = 2.48; EM["flex", "h"] = 2.03; EM["resl", "h"] = 2.83; EM["team", "h"] = 2.19; EM["pmat", "h"] = 3.12; EM["acap", "h"] = 0.85; EM["pcap", "h"] = 0.88; EM["pcon", "h"] = 0.90; EM["aexp", "h"] = 0.88; EM["pexp", "h"] = 0.91; EM["ltex", "h"] = 0.91; EM["tool", "h"] = 0.90; EM["site", "h"] = 0.93; EM["sced", "h"] = 1.00; EM["rely", "h"] = 1.10; EM["data", "h"] = 1.14; EM["cplx", "h"] = 1.17; EM["ruse", "h"] = 1.07; EM["docu", "h"] = 1.11; EM["time", "h"] = 1.11; EM["stor", "h"] = 1.05; EM["pvol", "h"] = 1.15; #Cocomo II precise data for the very high rating... EM["prec", "vh"] = 1.24; EM["flex", "vh"] = 1.01; EM["resl", "vh"] = 1.41; EM["team", "vh"] = 1.10; EM["pmat", "vh"] = 1.56; EM["acap", "vh"] = 0.71; EM["pcap", "vh"] = 0.76; EM["pcon", "vh"] = 0.81; EM["aexp", "vh"] = 0.81; EM["pexp", "vh"] = 0.85; EM["ltex", "vh"] = 0.84; EM["tool", "vh"] = 0.78; EM["site", "vh"] = 0.86; EM["sced", "vh"] = 1.00; EM["rely", "vh"] = 1.26; EM["data", "vh"] = 1.28; EM["cplx", "vh"] = 1.34; EM["ruse", "vh"] = 1.15; EM["docu", "vh"] = 1.23; EM["time", "vh"] = 1.29; EM["stor", "vh"] = 1.17; EM["pvol", "vh"] = 1.30; #Cocomo II precise data for the extra high rating... EM["prec", "xh"] = 0.00; EM["flex", "xh"] = 0.00; EM["resl", "xh"] = 0.00; EM["team", "xh"] = 0.00; EM["pmat", "xh"] = 0.00; EM["site", "xh"] = 0.80; EM["cplx", "xh"] = 1.74; EM["ruse", "xh"] = 1.24; EM["time", "xh"] = 1.63; EM["stor", "xh"] = 1.46; } } { if ( (($1,$2) in EM) && (($1,$3) in EM) && (($1,$4) in EM) ) { #print $1,EM[$1,$2],EM[$1,$3],EM[$1,$4] printf("%s,%.3f,%.3f,%.3f\n",$1,EM[$1,$2],EM[$1,$3],EM[$1,$4]); } else {print $0} }