;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; This file is part of "NOVA": NOVA = search + COCOMO tools ; Copyright, 2008, Tim Menzies tim@menzies.us ; ; NOVA is free software: you can redistribute it and/or modify ; it under the terms of the GNU General Public License as published by ; the Free Software Foundation, either version 3 of the License, or ; (at your option) any later version. ; ; NOVA is distributed in the hope that it will be useful, ; but WITHOUT ANY WARRANTY; without even the implied warranty of ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ; GNU General Public License for more details. ; You should have received a copy of the GNU General Public License ; a long with NOVA. If not, see . ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun search0 (what &key (repeats 10000)) (init-db) ; need some background knowledge (worker0 what repeats) t) (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 (med spread) (median log) (let ((d (make-dist :fuzz 10000))) (dist-adds log d) (terpri) (distogram d :header `(:constraints ,constraints :median ,med :spread ,spread) :shrink 100 :lwidth 10 :rwidth 6 :shrink 5))))