(defun random-walsh (&optional (outfile "random.dat") (times 10000)) (let ((result '())) (with-open-file (out outfile :direction :output :if-exists :supersede) (dotimes (i times) ;(print (walsh-con-random)) (setf result (walsh-con-random)) (format out "~a ~a ~a~%" (first result) (second result) (third result)))))) (defun walsh-con-random (&optional (p.xy (+ (random 500) 1)) ;(f.1 (+ (random 5000) 1)) (f.1 (+ (* (random 50) 10) 1)) (t.1 .2) (p.0 .403) (p.1 .272) (s.1 .070)) (let ((lr (/ (* t.1 p.0 p.xy) (* p.1 s.1 f.1)))) (if (> lr 50) (setf lr 50)) `(,p.xy ,f.1 ,lr)))