BEGIN { C[95]=1.96; C[99]=2.58; FS = ","; OFMT = "%.10f"; CONVFMT = "%.10f"; #file = "simlog.csv"; max=0; maxPoint=0; out; N; maxEnergy; 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>max) {max = $6; maxPoint=simNum;} policyMedE[simNum] = $6; policySpE[simNum] = $7; policyMedEff[simNum] = $10; policySpEff[simNum] = $11; policyMedDef[simNum] = $14; policySpDef[simNum] = $15; policyMedTh[simNum] = $18; policySpTh[simNum] = $19; policyMedMon[simNum] = $22; policySpMon[simNum] = $23; simNum++; S[simNum]=$4; S2[simNum]=$5; } END { for (i=maxPoint; i" ) maxPoint = j; } numPol = 0; if (slog==1) print "\nNumber of total policies is " simNum "\n"; output = "Number of total policies is " simNum "\n\n"; FirstMedE = 0; FirstSpE = 0; FirstMedEffort = 0; FirstSpEffort = 0; FirstMedDefects = 0; FirstSpDefects = 0; FirstMedThreat = 0; FirstSpThreat = 0; FirstMedMonths = 0; FirstSpMonths = 0; maxMedE = 0; maxSpE = 0; maxMedEffort = 0; maxSpEffort = 0; maxMedDefects = 0; maxSpDefects = 0; maxMedThreat = 0; maxSpThreat = 0; maxMedMonths = 0; maxSpMonths = 0; for (i=simNum-1; i>=maxPoint; 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 == maxPoint) { maxMedE = policyMedE[i]; maxSpE = policySpE[i]; maxMedEffort = policyMedEff[i]; maxSpEffort = policySpEff[i]; maxMedDefects = policyMedDef[i]; maxSpDefects = policySpDef[i]; maxMedThreat = policyMedTh[i]; maxSpThreat = policySpTh[i]; maxMedMonths = policyMedMon[i]; maxSpMonths = 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 "," maxEnergy "," numPol "," attNumber "," FirstMedE "," FirstSpE "," FirstMedEffort "," FirstSpEffort "," \ FirstMedDefects "," FirstSpDefects "," FirstMedThreat "," FirstSpThreat "," FirstMedMonths "," FirstSpMonths "," maxMedE "," maxSpE "," \ maxMedEffort "," maxSpEffort "," maxMedDefects "," maxSpDefects "," maxMedThreat "," maxSpThreat "," maxMedMonths "," maxSpMonths "," \ stratVal "," bfcVal > outdata; if (bfcVal == "bfc") { print projectVal "," policyVal "," scoring "," mutation "," alpha "," beta "," gamma "," delta "," relydefect "," coolFactor "," run "," N ","\ SANum "," SATime "," TotalTime "," maxEnergy "," numPol "," attNumber "," FirstMedE "," FirstSpE "," FirstMedEffort "," FirstSpEffort "," \ FirstMedDefects "," FirstSpDefects "," FirstMedThreat "," FirstSpThreat "," FirstMedMonths "," FirstSpMonths "," FirstMedE "," FirstSpE "," \ FirstMedEffort "," FirstSpEffort "," FirstMedDefects "," FirstSpDefects "," FirstMedThreat "," FirstSpThreat "," FirstMedMonths "," FirstSpMonths "," \ stratVal ",nothing" > 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; }