(egs :is (eg '(is 'acap '(4 5))) (eg '(is 'pmat '(4 5 6 7 8))) ) (defun ?em (x) (make-em :range (?elt (?bag (em-range x))) :effort (?num (em-effort x)) :rin (?num (em-rin x)) :din (?num (em-din x)) :cin (?num (em-cin x)))) (defun ?sf (x) (make-sf :range (?elt (?bag (sf-range x))) :effort (?num (sf-effort x)) :rsf (?num (sf-rsf x)) :dsf (?num (sf-dsf x)) :csf (?num (sf-csf x)))) (defun ?dr (x) (make-dr :range (?elt (?bag (dr-range x))) :rout (?num (dr-rout x)) :dout (?num (dr-dout x)) :cout (?num (dr-cout x)))) (egs :? (eg '(progn (coc-init) (dotimes (i 2) (print (?em (geta 'acap (all))))))) (eg '(progn (coc-init) (dotimes (i 2) (print(?sf (geta 'pmat (all))))))) (eg '(progn (coc-init) (dotimes (i 2) (print(?dr (geta 'aa (all))))))) (eg '(progn (coc-init) (dotimes (i 2) (print (?a (geta 'a (all))))))) (eg '(progn (dotimes (i 2) (coc-init) (print (?b (geta 'a (all)) (?a (geta 'a (all)))))))) (eg '(progn (dotimes (i 10) (coc-init) (print (?kloc (geta 'kloc (all)))))))) ;; (defun effort () ;; (* (a) ;; (expt (ksloc) ;; (+ (b) ;; (* 0.01 ;; (+ (prec) (flex) (resl) (team) (pmat))))) ;; (time) (stor) (data) (pvol) (ruse) (rely) (docu) (acap) ;; (pcap) (pcon) (apex) (plex) (ltex) (tool) (sced) (cplx) (site))) (defun ? (key) (let ((range (geta key (all)))) (case (type-of range) (one-a (?one-a range)) (one-b (?one-b range)) (bag (?bag range)) (num (?num range)) (sf (?sf range)) (dr (?dr range)) (em (?em range)) (otherwise (warn "can't handle ~a of type ~a" range (type-of range)))))) (defun guess-demo-all () `((aa . ,(make-bag :range '(10 20 30))) (bb . ,(make-num :min 100 :max 200)) (cc . ,(make-num :min 100 :max 200)) (dd . ,(make-num :min 100 :max 200)) (ee . ,(make-num :min 100 :max 200)) (ff . ,(make-num :min 100 :max 200)) (gg . ,(make-num :min 100 :max 200)) (hh . ,(make-num :min 100 :max 200)) (ii . ,(make-num :min 100 :max 200)) (jj . ,(make-num :min 100 :max 200)) (kk . ,(make-num :min 100 :max 200)) (ll . ,(make-num :min 100 :max 200)) (mm . ,(make-num :min 100 :max 200)) (nn . ,(make-bag :range '(10 20 30))) (oo . ,(make-num :min 100 :max 200)) (pp . ,(make-num :min 100 :max 200)) (qq . ,(make-num :min 100 :max 200)) (rr . ,(make-num :min 100 :max 200)) (ss . ,(make-num :min 100 :max 200)) (tt . ,(make-num :min 100 :max 200)) (vv . ,(make-num :min 100 :max 200)) (uu . ,(make-num :min 100 :max 200)) (ww . ,(make-num :min 100 :max 200)) (xx . ,(make-num :min 100 :max 200)) (yy . ,(make-num :min 100 :max 200)) (zz . ,(make-num :min 100 :max 200)))) (defun demo-guess () (let ((*db* (make-db :all (guess-demo-all)))) (dotimes (i 1000000 *db*) (let ((x (?elt '(aa bb cc dd ee ff gg hh ii jj kk ll mm nn oo pp qq rr ss tt uu vv ww xx yy zz)))) (! x))))) (defun demo-guess1 () (let ((*db* (make-db :all (guess-demo-all)))) (dotimes (i 1000000 *db*) (let ((x (?elt '(aa bb cc dd ee ff gg hh ii jj kk ll mm nn oo pp qq rr ss tt uu vv ww xx yy zz)))) x))))