;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; 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 . ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun months (&optional (pm (effort))) "Returns 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))) (sced-percents '((1 . 75) (2 . 85) (3 . 100) (4 . 130) (5 . 160))) (sced-percent (geta sced sced-percents)) (pm-no-sced (/ pm (f sced))) (e-less-b (* 0.01 (+ (s prec) (s flex) (s resl) (s team) (s pmat)))) (f (+ d (* 0.2 e-less-b)))) (* c (expt pm-no-sced f) (/ sced-percent 100))))) (defun demo-months1 (&optional (*db* *db*)) "Calculates months 10 times." (let (out) (dotimes (i 10 (sort out #'<)) (push (demo-months0) out)))) (defun demo-months2 (&optional (*db* *db*)) "Displays the distribution of 1000 months calculations." (let ((d (make-dist :fuzz 2500))) (dotimes (i 1000) (dist-add (demo-months0) d)) (format t "Months estimates, rounded to the nearest 100~%") (distogram d :shrink 50 :lwidth 10 :rwidth 6))) (defun demo-months0 () "Initializes the *db* to COCOMO defaults and calculates effort and months." (init-db) (let* ((e (effort)) (m (months e))) (values e m))) (egs :months (eg '(demo-months1) :of "calculating months 10 times") (eg '(demo-months2) :of "displaying the distribution of 1000 months calculations"))