(defun dfid (type) (let ((parameters (list 'DYNAMISIM 'CRITICALITY 'CULTURE 'TEAMSIZE 'SIZE 'TEAM-ALPHA)) (valuesOfEach 10) (listOfTrials (list)) (triedSinceBest 0) (level 0) (bestTreatment (list)) (bestScore 0)) (while (and (< level 6) (< triedSinceBest 100)) (push (list (list) 0 bestScore (copy-list parameters)) listOfTrials) (while (and (not (null listOfTrials)) (< triedSinceBest 100)) (let* ((treatment (pop listOfTrials)) (score (runpom2 type (first treatment)))) ;(format t "~A ~A" score treatment) (if (> score bestScore) (progn (format t "New Best found on level ~A: ~A, ~A~%" level score (first treatment)) (setf bestScore score bestTreatment (first treatment) triedSinceBest 0))) ;(format t "~%----_~A ~A ~%" score (third treatment)) (if (> score (third treatment)) (if (not (= (second treatment) level)) (progn (dotimes (x valuesOfEach) (dolist (parameter (fourth treatment)) (push (list (append (list (list parameter (our-sample parameter))) (first treatment)) (1+ (second treatment)) score (remove-if #'(lambda (x) (equal x parameter)) (copy-list (fourth treatment)))) listOfTrials)))))))) (format t "Leash extended to ~A~%" (1+ level)) (incf level)) (format t "~%================~%Best found: ~A, ~A~%===============~%Starting backselect~%~%" bestScore bestTreatment) (backselect bestTreatment type))) (defun demo-search6 () (format t "************************************~% This is Iterative Deepening Depth First Search (IDDFS) ~%**********************************************~%") (format t "I'm now running IDDFS with Agile~%") (dfid 'AG) (format t "~%~%------------------------------------------~%") (format t "I'm now running IDDFS with Agile2~%") (dfid 'AG2) (format t "~%~%------------------------------------------~%") (format t "I'm now running IDDFS with Planbased~%") (dfid 'PB) (format t "~%~%------------------------------------------~%") (format t "I'm now running IDDFS with Hybrid~%") (dfid 'HY) )