(defmodel sh ((:scale x 1.4 1.6 .001) (:scale y 1.4 1.6 .001) (:scale sd .00001 .00025 .00001) (:scale mu 1.5181932 15.181932 1.5181932) (:scale tau 0.0036737733 0.036737733 0.0036737733)) ((format t "Wut~%") (let* ((l (/ sd tau)) (ll (* l l)) (u (/ (- x y) (* sd (sqrt 2)))) (z (* .5 (+ x y))) (v (/ (- z mu) (* tau (expt (+ 1 (* .5 ll)) .5)))) (factor (* (/ (+ 1 ll) (* l (expt (+ 2 ll) .5))) (exp (* (/ -1 (* 2 (+ 1 ll))) (- (* u u) (* v v))))))) factor)) ((format t "Start!~%") (let ((s (demo-seheult)) str (xf 0)) (labels ((between (left right val) (and (<= left val) (<= val right)))) (dotimes (i (length *x-freqs*) xf) (when (<= (value x) (car (nth i *x-freqs*))) (unless (< (1- i) 0) (configure x :label (format nil "x (~A)" (second (nth (1- i) *x-freqs*)))) (return)))) (format t "Frequency of x=~A is ~A~%" (value x) xf) (dolist (NANER (gethash 'x s)) (when (between (first NANER) (second NANER) (value x)) (configure x :troughcolor (intern (format nil "gray~A" (round (* 100 (first (last NANER))))))) (format t "Value: ~A~%" (round (* 100 (first (last NANER))))))) (dotimes (i (length *y-freqs*) xf) (when (<= (value y) (car (nth i *y-freqs*))) (unless (< (1- i) 0) (configure y :label (format nil "y (~A)" (second (nth (1- i) *y-freqs*)))) (return)))) (dolist (NANER (gethash 'y s)) (if (between (first NANER) (second NANER) (value y)) (configure y :troughcolor (intern (format nil "gray~A" (round (* 100 (first (last NANER))))))))) (dotimes (i (length *sd-freqs*) xf) (when (<= (value sd) (car (nth i *sd-freqs*))) (unless (< (1- i) 0) (configure sd :label (format nil "x (~A)" (second (nth (1- i) *sd-freqs*)))) (return)))) (dolist (NANER (gethash 'sd s)) (if (between (first NANER) (second NANER) (value sd)) (configure sd :troughcolor (intern (format nil "gray~A" (round (* 100 (first (last NANER))))))))) (dolist (NANER (gethash 'mu s)) (if (between (first NANER) (second NANER) (value mu)) (configure mu :troughcolor (intern (format nil "gray~A" (round (* 100 (first (last NANER))))))))) (dolist (NANER (gethash 'tau s)) (if (between (first NANER) (second NANER) (value tau)) (configure tau :troughcolor (intern (format nil "gray~A" (round (* 100 (first (last NANER))))))))) (format t "END~%"))))