;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; 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 . ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (in-package #:xomo.experiments) (defun extract-xomo-value (x) (typecase x ;;FIXME get actual values for em,sf,dr (em (em2effort x)) (sf (sf2effort x)) (dr (dr2rout x)) ;;TODO this is what ous had, but it doesn't make sense to me (t x))) (defun extract-xomo-rating (x) (typecase x (bag (bag-range x)) (t x))) (defun output-xomo-simulations (&key (times 1000) constraints (scoring-methods '(effort months defects threat)) (output-directory nova.settings:*nova-output-dir*) (extract-value-fn #'extract-xomo-value) (output-file-name "xomo-simulations.csv")) (let ((input (nova.apps.interfaces:make-simulation-input :scoring-methods scoring-methods :constraints constraints)) (keylist (append (all-parameters-attributes) (all-tunable-parameters-attributes) (all-sf-attributes) (all-em-attributes) (all-dr-attributes) scoring-methods))) (ensure-directories-exist output-directory :verbose t) (nova.apps.interfaces.csv:output-simulation (nova.apps.interfaces:nova-simulation-interface input times) (merge-pathnames output-file-name output-directory) :keylist keylist :extract-value extract-value-fn) t)) (defun output-xomo-verification-projects (&key (times 1000) (base-output-directory nova.settings:*nova-output-dir*)) (let ((case-study-ids '(GROUND FLIGHT OSP2 OSP NOVA.IMPL.CASE-STUDIES:DEFAULT)) (output-directory (merge-pathnames "xomo-verification/" base-output-directory)) (file-name-pattern "xomo-verification-~a.csv")) (dolist (case-study-id case-study-ids) (with-new-db (init-db) (with-treatments (case-study-constraints (lookup-case-study 'xomo.case-studies:verification)) (output-xomo-simulations :times times :constraints (complete-treatments (case-study-constraints (lookup-case-study case-study-id))) :extract-value-fn #'extract-xomo-rating :output-directory output-directory :output-file-name (format nil file-name-pattern (string-downcase case-study-id)))))))) (defun xomo-parameters-distrogram-simulation () "displays distograms for kloc, a, b, c, d to make sure the distrobutions for each are linear" (let ((runs 1000) (shrink 10) (kloc-d (make-dist :fuzz 100 )) (a-d (make-dist :fuzz 1 )) (b-d (make-dist :fuzz .1)) (c-d (make-dist :fuzz .1)) (d-d (make-dist :fuzz .01))) (dolist (result (nova.apps.simulation:nova-simulate :runs runs)) (dist-add (geta 'kloc result) kloc-d) (dist-add (geta 'a result) a-d) (dist-add (geta 'b result) b-d) (dist-add (geta 'c result) c-d) (dist-add (geta 'd result) d-d)) (distogram kloc-d :header "kloc" :shrink shrink) (distogram a-d :header "a" :shrink shrink) (distogram b-d :header "b" :shrink shrink) (distogram c-d :header "c" :shrink shrink) (distogram d-d :header "d" :shrink shrink)))