BEGIN { C[95]=1.96; C[99]=2.58; FS = ","; OFMT = "%.10f"; CONVFMT = "%.10f"; #file = "simlog.csv"; min=1000000000000; minPoint=0; out; N; minEnergy; scoring; SANum; TotalTime; SATime; policyVal; projectVal; run; alpha; beta; gamma; delta; relydefect; coolFactor; stratVal; bfcVal; slog; simNum=0; getline; S[simNum]=0; S2[simNum]=0; } { policies[simNum] = $1 " = " $2; attributeName[simNum] = $1; if ($6=minPoint; i--) { if (i==simNum-1) { FirstMedE = policyMedE[i]; FirstSpE = policySpE[i]; FirstMedEffort = policyMedEff[i]; FirstSpEffort = policySpEff[i]; FirstMedDefects = policyMedDef[i]; FirstSpDefects = policySpDef[i]; FirstMedThreat = policyMedTh[i]; FirstSpThreat = policySpTh[i]; FirstMedMonths = policyMedMon[i]; FirstSpMonths = policySpMon[i]; } if (slog==1) print policies[i]; output = output policies[i] "\n"; numPol++; atts[attributeName[i]]++; if (i == minPoint) { MinMedE = policyMedE[i]; MinSpE = policySpE[i]; MinMedEffort = policyMedEff[i]; MinSpEffort = policySpEff[i]; MinMedDefects = policyMedDef[i]; MinSpDefects = policySpDef[i]; MinMedThreat = policyMedTh[i]; MinSpThreat = policySpTh[i]; MinMedMonths = policyMedMon[i]; MinSpMonths = policySpMon[i]; attNumber=0; for (a in atts) { attNumber++; } if (slog==1){ print "\nNumber of recommended policies is " numPol; print "\nNumber of distinct attributes is " attNumber; print "\nResults of applying above policies:"; print "\tEnergy:\n\t\tmedian: " policyMedE[i] "\n\t\tspread: " policySpE[i]; print "\tEffort:\n\t\tmedian: " policyMedEff[i] "\n\t\tspread: " policySpEff[i]; print "\tDefects:\n\t\tmedian: " policyMedDef[i] "\n\t\tspread: " policySpDef[i]; print "\tThreat:\n\t\tmedian: " policyMedTh[i] "\n\t\tspread: " policySpTh[i]; print "\tMonths:\n\t\tmedian: " policyMedMon[i] "\n\t\tspread: " policySpMon[i]; } output = output "\nNumber of recommended policies is " numPol "\n"; output = output "\nNumber of distinct attributes is " attNumber "\n"; output = output "\nResults of applying above policies:"; output = output "\n\tEnergy:\n\t\tmedian: " policyMedE[i] "\n\t\tspread: " policySpE[i]; output = output "\n\tEffort:\n\t\tmedian: " policyMedEff[i] "\n\t\tspread: " policySpEff[i]; output = output "\n\tDefects:\n\t\tmedian: " policyMedDef[i] "\n\t\tspread: " policySpDef[i]; output = output "\n\tThreat:\n\t\tmedian: " policyMedTh[i] "\n\t\tspread: " policySpTh[i]; output = output "\n\tMonths:\n\t\tmedian: " policyMedMon[i] "\n\t\tspread: " policySpMon[i]; break; } } outlog = out "/policy.txt"; print output > outlog; outdata = out "/data"; print projectVal "," policyVal "," scoring "," mutation "," alpha "," beta "," gamma "," delta "," relydefect "," coolFactor "," run "," N ","\ SANum "," SATime "," TotalTime "," minEnergy "," numPol "," attNumber "," FirstMedE "," FirstSpE "," FirstMedEffort "," FirstSpEffort "," \ FirstMedDefects "," FirstSpDefects "," FirstMedThreat "," FirstSpThreat "," FirstMedMonths "," FirstSpMonths "," MinMedE "," MinSpE "," \ MinMedEffort "," MinSpEffort "," MinMedDefects "," MinSpDefects "," MinMedThreat "," MinSpThreat "," MinMedMonths "," MinSpMonths "," \ stratVal "," bfcVal > outdata; } function compare(conf,befores,afters,befores2, afters2,beforen,aftern) { if(same(conf,befores,afters,befores2, afters2,beforen,aftern)) return "="; if (befores/beforen > afters/aftern) return "<"; else return ">"; } function same(conf,befores,afters,befores2, afters2,beforen,aftern,\ ssa,ssb,pooled,sxaxb,t,tcrtical) { ssa = befores2-(befores^2/beforen); ssb = afters2-(afters^2 /aftern); pooled = (ssa + ssb) /(beforen + aftern - 2); sxaxb = sqrt(pooled *(1/beforen + 1/aftern)); t= (afters/aftern - befores/beforen)/sxaxb; t = (t < 0 ? -1*t : t) tcritical= 2.101; #C[conf] return tcritical > t; }