(defun search0 (what &key (repeats 10000)) (init-db) ; need some background knowledge (worker0 what repeats)) (defun worker0 (what repeats) (let* ((old (range? what)) (least (list (car old))) (most (last old))) (slave0 what repeats least) (slave0 what repeats most))) (defun slave0 (what repeats constraints) (let ((log '())) (init-db) ; fresh problem (range! what constraints) ; set constraints (dotimes (i repeats) ; try some stuff (zaps) ; forget old calculations (push (effort) log)) (report0 what constraints log))) (defun report0 (what constraints log) (multiple-value-bind (mid spread) (median log) (let ((d (make-dist :fuzz 10000))) (dist-adds log d) (terpri) (distogram d :header `(:constraints ,constraints :median ,mid :spread ,spread) :shrink 100 :lwidth 10 :rwidth 6 :shrink 5))))