(defmodel grove ((: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* ((u (/ tau sd)) (v (/ (* (- x y)(- x y) ) (* -4 sd sd) )) (w (/ (* (- y mu)(- y mu) ) (* 2 tau tau))) (lr (* u (exp ( + v w ))))) lr)) ((format t "Start!~%") (let ((s (demo-grove)) 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~%"))))