;;; -*- Mode: LISP; Syntax: Common-Lisp; Package: LKB -*- ;;; Copyright (c) 2004 ;;; John Carroll, Ann Copestake, Robert Malouf, Stephan Oepen; ;;; see `LICENSE' for conditions. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; file: statistics.lsp ;;; module: centralized accounting: parser, generator, et al. performance ;;; version: 0.0 (17-oct-05) ;;; written by: oe, uio ;;; last update: ;;; updated by: ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; author | date | modification ;;; ------------------|-------------|------------------------------------------ ;;; | | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (in-package :lkb) (eval-when (:compile-toplevel :load-toplevel :execute) (defstruct statistics (unifications 0 :type fixnum) (copies 0 :type fixnum) (subsumptions 0 :type fixnum) (mtasks 0 :type fixnum) (ftasks 0 :type fixnum) (etasks 0 :type fixnum) (stasks 0 :type fixnum) (pedges 0 :type fixnum) (aedges 0 :type fixnum) (uedges 0 :type fixnum) (equivalent 0 :type fixnum) (proactive 0 :type fixnum) (retroactive 0 :type fixnum) (generalised 0 :type fixnum) (frozen 0 :type fixnum) (failures 0 :type fixnum) (hypotheses 0 :type fixnum) (decompositions 0 :type fixnum) (comparisons 0 :type fixnum))) (defmethod print-object ((object statistics) stream) (format stream "#[S unifier <~a:~a> ~ processor <~a:~a:~a @ ~a:~a> ~ packing <~a: ~a+~a+~a+~a ~a:~a> ~ unpacking <~a:~a @ ~a> ~ comparisons <~a>]" (statistics-unifications object) (statistics-copies object) (statistics-ftasks object) (statistics-etasks object) (statistics-stasks object) (statistics-aedges object) (statistics-pedges object) (statistics-subsumptions object) (statistics-equivalent object) (statistics-proactive object) (statistics-retroactive object) (statistics-generalised object) (statistics-frozen object) (statistics-failures object) (statistics-hypotheses object) (statistics-decompositions object) (statistics-uedges object) (statistics-comparisons object))) (#+:sbcl sb-ext:defglobal #-:sbcl defvar *statistics* (make-statistics)) (declaim (type statistics *statistics*)) (defun reset-statistics (&optional (statistics *statistics*)) (setf (statistics-unifications statistics) 0) (setf (statistics-copies statistics) 0) (setf (statistics-subsumptions statistics) 0) (setf (statistics-mtasks statistics) 0) (setf (statistics-ftasks statistics) 0) (setf (statistics-etasks statistics) 0) (setf (statistics-stasks statistics) 0) (setf (statistics-pedges statistics) 0) (setf (statistics-aedges statistics) 0) (setf (statistics-uedges statistics) 0) (setf (statistics-equivalent statistics) 0) (setf (statistics-proactive statistics) 0) (setf (statistics-retroactive statistics) 0) (setf (statistics-generalised statistics) 0) (setf (statistics-frozen statistics) 0) (setf (statistics-failures statistics) 0) (setf (statistics-hypotheses statistics) 0) (setf (statistics-decompositions statistics) 0) (setf (statistics-comparisons statistics) 0))