(defun make-runtime() (dotimes (x 5) (runtime 1000 (format nil "data/runtime-~A.dat" x)) (print x))) (defun runtime(&optional (number 10000) (filename "data/runtime.dat")) (let ((policies (list 'AG 'AG2 'HY 'PB)) (totalscores (make-hash-table))) (dolist (policy policies) (print policy) (let ((scores (list))) (dotimes (x number) (let* ((start (get-internal-run-time)) (score (floor (* 100 (score (POM2 1 policy))))) (size (get-static 'SIZE)) (runtime (/ (- (get-internal-run-time) start) internal-time-units-per-second))) (push (list runtime size score) scores))) (setf (gethash policy totalscores) scores))) (with-open-file (out filename :direction :output :if-exists :supersede :if-does-not-exist :create) (maphash #'(lambda (k v) (format out "#~A~%" k) (dolist (score v) (format out "~A ~A ~A~%" (float (first score)) (second score) (third score))) (format out "~%~%")) totalscores))))