;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; This file is part of "NOVA": NOVA = search + COCOMO tools ; Copyright, 2008, Tim Menzies tim@menzies.us ; ; NOVA is free software: you can redistribute it and/or modify ; it under the terms of the GNU General Public License as published by ; the Free Software Foundation, either version 3 of the License, or ; (at your option) any later version. ; ; NOVA is distributed in the hope that it will be useful, ; but WITHOUT ANY WARRANTY; without even the implied warranty of ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ; GNU General Public License for more details. ; You should have received a copy of the GNU General Public License ; a long with NOVA. If not, see . ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; XXX (! 'sced) is wrong (defun months (&optional (pm (effort))) "return elapsed development time (in months)" (macrolet ((f (x) `(em2effort ',x)) (s (x) `(sf2effort ',x))) (let* ((c 3.67) (d 0.28) (sced (em-range (! 'sced))) (scedPercents '((1 . 75) (2 . 85) (3 . 100) (4 . 130) (5 . 160))) (scedPercent (geta sced scedPercents)) (pmNs (/ pm (f sced))) (elessb (* 0.01 (+ (s prec) (s flex) (s resl) (s team) (s pmat)))) (f (+ d (* 0.2 elessb)))) (* c (expt pmNs f) (/ scedPercent 100))))) (defun demo-months1 (&optional (*db* *db*)) (let (out) (dotimes (i 10 (sort out #'<)) (push (demo-months0) out)))) (defun demo-months2 (&optional (*db* *db*)) (let ((d (make-dist :fuzz 2500))) (dotimes (i 1000) (dist-add (demo-months0) d)) (format t "~%Elapsed development time, ~%rounded to nearest 100~%") (distogram d :shrink 50 :lwidth 10 :rwidth 6))) (defun demo-months0 () (init-db) (let* ((eff (effort)) (tdev (months eff))) (values eff tdev))) (defun eff-mnths-demo (&optional (repeats 1000)) (let (pm tdev (log '())) (init-db) ; fresh problem (dotimes (i repeats) ; try some stuff (zaps) ; forget old calculations (setf pm (effort)) (setf tdev (months pm)) (push (cons pm tdev) log)) (2plot log "pm-png" "pm" "tdev"))) (defun 2plot (l title x y &optional (dir *tmp-dir*) (file0 "plot")) (let* ((file (string-downcase (format nil "~a~a.dat" dir file0))) (png (string-downcase (format nil "~a~a.png" dir file0)))) (with-open-file (*standard-output* file :direction :output :if-exists :supersede) (dolist (one l) (format t "~a ~a~%" (car one) (cdr one)))))) #| pm = 9.0188*Ln(months) - 20.815 R^2 = 0.6557 pm 180 ++--------+---------+---------+---------+---------+---------+--------++ + + + + + + eff-mnths A + 160 ++ A ++ | A | 140 ++ ++ | A | 120 ++ A ++ | A A AA A | 100 ++ AAA +A | A A AA | | A A AAA A A AA A A A A A | 80 ++AAA AAAA A A A ++ |AAA AAA AA A | 60 +AAAAAAAAA AA A A ++ AAAAAAAA AAA A | 40 AAAAAAA ++ AAAA | 20 AA ++ A + + + + + + + 0 A+--------+---------+---------+---------+---------+---------+--------++ 0 10000 20000 30000 40000 50000 60000 70000 months |# (egs :months (eg '(demo-months1)) (eg '(demo-months2)) )