Browse Source

update pert table

arzzen 9 years ago
parent
commit
729c740666
1 changed files with 13 additions and 7 deletions
  1. 13
    7
      pert.sh

+ 13
- 7
pert.sh View File

22
 function _divider
22
 function _divider
23
 {
23
 {
24
     divider=------------------------------
24
     divider=------------------------------
25
-    divider=" "$divider$divider$divider
26
-    width=85
25
+    divider=" +"$divider$divider$divider"+"
26
+    width=88
27
     
27
     
28
-    printf "%$width.${width}s\n" "$divider"
28
+    printf "%$width.${width}s+\n" "$divider"
29
 }
29
 }
30
 
30
 
31
-header="\n %-12s |%11s |%10s |%12s |%9s |%9s |%9s\n"
32
-format=" %-12s |%11s |%10s |%12s |%9s |%9s |%9s\n"
31
+format=" | %-12s |%11s |%10s |%12s |%9s |%9s |%9s |\n"
33
 
32
 
34
 counter=0
33
 counter=0
35
 total_estimate=0
34
 total_estimate=0
54
     
53
     
55
     # header
54
     # header
56
     if [[ $counter = 1 ]]; then
55
     if [[ $counter = 1 ]]; then
57
-        printf "$header" "#" "optimistic" "realistic" "pessimistic" "duration" "risk" "variance"
56
+        echo -e "\nTasks\n"
57
+        _divider
58
+        printf "$format" "#" "optimistic" "realistic" "pessimistic" "duration" "risk" "variance"
58
         _divider
59
         _divider
59
     fi
60
     fi
60
     
61
     
86
     # footer        
87
     # footer        
87
     _divider
88
     _divider
88
     printf "$format" "summary" "-" "-" "-" $total_estimate $total_standard_deviation $total_variance
89
     printf "$format" "summary" "-" "-" "-" $total_estimate $total_standard_deviation $total_variance
90
+    _divider
91
+    
92
+    echo -e "\nThree point estimates\n"
89
     
93
     
90
-    #echo -e "\nThree point estimate:"
94
+    echo -e " 1 Sigma - 68% confidence:" $(_calc "$total_estimate - $total_variance") "-" $(_calc "$total_estimate + $total_variance")
95
+    echo -e " 2 Sigma - 95% confidence:" $(_calc "$total_estimate - 2 * $total_variance") "-" $(_calc "$total_estimate + 2 * $total_variance")
96
+    echo -e " 2 Sigma - 99.7% confidence:" $(_calc "$total_estimate - 3 * $total_variance") "-" $(_calc "$total_estimate + 2 * $total_variance")
91
     
97
     
92
 fi
98
 fi
93
 
99
 

Loading…
Cancel
Save