cd ../data Data=`pwd` cd ../eg . sandbox counts() { for Goal in 2 #0 1 2 3 4 5 do gawk -F, 'BEGIN {OFS=","} Goal && $2+0 > Goal { next} { for(I=1;I<=NF;I++) $I = $I+0; Phase[$1]=1; Severity[$2]=1; Sum[$1] += $3 } END {for(P in Phase) print P, Sum[P] } ' Goal="$Goal" $1 > count.tmp score count.tmp $2 done } score() { gawk -F, ' BEGIN { OFS=","; Rare=0.1} {gsub(/[ \t]/,"")} {gsub(/#.*/,"")} /^[ \t]*$/ {next} Pass==1 { Cost[$1]=$2 ; MinCost = $2 < MinCost ? $2 : MinCost; MaxCost = $2 > MaxCost ? $2 : MaxCost; } Pass==2 { Freq[$1]=$2 ; MinFreq = $2 < MinFreq ? $2 : MinFreq; MaxFreq = $2 > MaxFreq ? $2 : MaxFreq; } Pass==3 { Issue[$1]=$2 ; MinIssue = $2 < MinIssue ? $2 : MinIssue; MaxIssue = $2 > MaxIssue ? $2 : MaxIssue; } END { for(Something in Cost) { Phase = int(Something); Early = ROI^(6 - Phase) I = (Issue[Phase] - MinIssue)/(MaxIssue - MinIssue) C = (Cost[Something] - MinCost )/(MaxCost - MinCost ) F = (Freq[Something] - MinFreq )/(MaxFreq - MinFreq ) if (F>Rare) if( (C*F) > 0 ) print Something,I^Early/(C*F) }} ' ROI=$2 Pass=1 $Data/costs.csv Pass=2 $Data/freq.csv Pass=3 $1 } printf "\n\nIssues^(ROI^(6-Phase)) / (Cost * Frequency)\n(ignoring low frequency tasks)\n\n" date for issues in $Data/issues_9robotic.csv $Data/issues_7manRated.csv do printf "\n\n===| domain = $issues |=========================\n\n" for ROI in 10 5 2 1 do printf "\n\n---| ROI = $ROI |--------------------------\n\n" counts $issues $ROI | malign > tmp (cd $Data bash ../norm $Tmp/tmp |cat -n ) done done