mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-11-24 07:20:29 +00:00
Estimate ranges in column view
* lisp/org-colview-xemacs.el (org-columns-compile-map): (org-columns-number-to-string): (org-columns-string-to-number): Handle estimate ranges. (org-estimate-mean-and-var): New function. (org-estimate-combine): New function. (org-estimate-print): New function. (org-string-to-estimate): New function.
This commit is contained in:
parent
55ea8ca071
commit
899e89518b
18
doc/org.texi
18
doc/org.texi
@ -4766,21 +4766,21 @@ Be aware that you can only have one summary type for any property you
|
||||
include. Subsequent columns referencing the same property will all display the
|
||||
same summary information.
|
||||
|
||||
The 'est+' summary type requires further explanation. It is used for
|
||||
combining task estimates, expressed as low-high ranges. For example, instead
|
||||
The @code{est+} summary type requires further explanation. It is used for
|
||||
combining estimates, expressed as low-high ranges. For example, instead
|
||||
of estimating a particular task will take 5 days, you might estimate it as
|
||||
5-6 days if you're fairly confident you know how much woark is required, or
|
||||
1-10 days if you don't really know what needs to be done. Both ranges
|
||||
average at 5.5 days, but the first represents a more predictable delivery.
|
||||
|
||||
When combining a set of such estimates, simply adding the lows and highs
|
||||
produces an unrealistically wide result. Instead, 'est+' adds the statistical
|
||||
mean and variance of the sub-tasks, generating a final estimate from the sum.
|
||||
For example, suppose you had ten tasks, each of which was estimated at 0.5 to
|
||||
2 days of work. Straight addition produces an estimate of 5 to 20 days,
|
||||
representing what to expect if everything goes either extremely well or
|
||||
extremely poorly. In contrast, 'est+' estimates the full job more
|
||||
realistically, at 10-15 days.
|
||||
produces an unrealistically wide result. Instead, @code{est+} adds the
|
||||
statistical mean and variance of the sub-tasks, generating a final estimate
|
||||
from the sum. For example, suppose you had ten tasks, each of which was
|
||||
estimated at 0.5 to 2 days of work. Straight addition produces an estimate
|
||||
of 5 to 20 days, representing what to expect if everything goes either
|
||||
extremely well or extremely poorly. In contrast, @code{est+} estimates the
|
||||
full job more realistically, at 10-15 days.
|
||||
|
||||
Here is an example for a complete columns definition, along with allowed
|
||||
values.
|
||||
|
@ -1700,8 +1700,7 @@ This will add overlays to the date lines, to show the summary for each day."
|
||||
(high (float (cadr v)))
|
||||
(mean (/ (+ low high) 2.0))
|
||||
(var (/ (+ (expt (- mean low) 2.0) (expt (- high mean) 2.0)) 2.0)))
|
||||
(list mean var)
|
||||
))
|
||||
(list mean var)))
|
||||
|
||||
(defun org-estimate-combine (&rest el)
|
||||
"Combine a list of estimates, using mean and variance.
|
||||
@ -1715,21 +1714,21 @@ and variances (respectively) of the individual estimates."
|
||||
(setq var (+ var (cadr stats)))))
|
||||
el)
|
||||
(let ((stdev (sqrt var)))
|
||||
(list (- mean stdev) (+ mean stdev)))
|
||||
))
|
||||
(list (- mean stdev) (+ mean stdev)))))
|
||||
|
||||
(defun org-estimate-print (e &optional fmt)
|
||||
"Prepare a string representation of an estimate, as two numbers with a '-' in between them."
|
||||
"Prepare a string representation of an estimate.
|
||||
This formats these numbers as two numbers with a \"-\" between them."
|
||||
(if (null fmt) (set 'fmt "%.0f"))
|
||||
(format "%s" (mapconcat (lambda (n) (format fmt n)) e "-")))
|
||||
|
||||
(defun org-string-to-estimate (s)
|
||||
"Convert a string to an estimate. The string should be two numbers joined with a '-'."
|
||||
"Convert a string to an estimate.
|
||||
The string should be two numbers joined with a \"-\"."
|
||||
(if (string-match "\\(.*\\)-\\(.*\\)" s)
|
||||
(list (string-to-number (match-string 1 s)) (string-to-number(match-string 2 s)))
|
||||
(list (string-to-number s) (string-to-number s))
|
||||
))
|
||||
|
||||
(list (string-to-number (match-string 1 s))
|
||||
(string-to-number(match-string 2 s)))
|
||||
(list (string-to-number s) (string-to-number s))))
|
||||
|
||||
(provide 'org-colview)
|
||||
(provide 'org-colview-xemacs)
|
||||
|
@ -1501,8 +1501,7 @@ This will add overlays to the date lines, to show the summary for each day."
|
||||
(high (float (cadr v)))
|
||||
(mean (/ (+ low high) 2.0))
|
||||
(var (/ (+ (expt (- mean low) 2.0) (expt (- high mean) 2.0)) 2.0)))
|
||||
(list mean var)
|
||||
))
|
||||
(list mean var)))
|
||||
|
||||
(defun org-estimate-combine (&rest el)
|
||||
"Combine a list of estimates, using mean and variance.
|
||||
@ -1516,22 +1515,21 @@ and variances (respectively) of the individual estimates."
|
||||
(setq var (+ var (cadr stats)))))
|
||||
el)
|
||||
(let ((stdev (sqrt var)))
|
||||
(list (- mean stdev) (+ mean stdev)))
|
||||
))
|
||||
(list (- mean stdev) (+ mean stdev)))))
|
||||
|
||||
(defun org-estimate-print (e &optional fmt)
|
||||
"Prepare a string representation of an estimate, as two numbers with a '-' in between them."
|
||||
"Prepare a string representation of an estimate.
|
||||
This formats these numbers as two numbers with a \"-\" between them."
|
||||
(if (null fmt) (set 'fmt "%.0f"))
|
||||
(format "%s" (mapconcat (lambda (n) (format fmt n)) e "-"))
|
||||
)
|
||||
(format "%s" (mapconcat (lambda (n) (format fmt n)) e "-")))
|
||||
|
||||
(defun org-string-to-estimate (s)
|
||||
"Convert a string to an estimate. The string should be two numbers joined with a '-'."
|
||||
"Convert a string to an estimate.
|
||||
The string should be two numbers joined with a \"-\"."
|
||||
(if (string-match "\\(.*\\)-\\(.*\\)" s)
|
||||
(list (string-to-number (match-string 1 s)) (string-to-number(match-string 2 s)))
|
||||
(list (string-to-number s) (string-to-number s))
|
||||
))
|
||||
|
||||
(list (string-to-number (match-string 1 s))
|
||||
(string-to-number(match-string 2 s)))
|
||||
(list (string-to-number s) (string-to-number s))))
|
||||
|
||||
(provide 'org-colview)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user