;;; This is a simple model with two rules competing and one leading ;;; to a success and another to a failure. Learning helps to shift ;;; the choice to a good rule. ;;; The model should work with both ACT-R 5 and ACT-R 4. ;;; ;;; Author: Roman Belavkin ;;; Contact: R.Belavkin@mdx.ac.uk ;;; Date: 17/06/2005 ;;; Date started: 26/2/2003 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun success-ratio () "Returns the success rate in percent" (let ((n (production-all-successes (get-safe-production 'goal-success))) (m (production-all-successes (get-safe-production 'goal-failure)))) (* 100 (/ n (+ n m))))) (Clear-All) (setf *penalty* .0) (setf *reward* .0) (sgp :era t :ut nil :egs nil ;; Learning parameters :ol t :pl t ;; Parameters Learning :ut nil ;; Traces :emt nil ;; Exact Matching Trace :pmt nil ;; Partial Matching Trace :pct t ;; Production Compilation Trace :act nil ;; Activation Trace :crt t ;; Conflict Resolution Trace :cst t ;; Conflict Set Trace :mt nil ;; Matches Trace. short or t :pt nil ;; Production Trace. short or t :ct t ;; Cycle Trace :lt nil ;; Latency Trace :ot t ;; Output Trace: prints the output of !output! commands :dmt nil ;; Declarative Memory Trace :gt t ;; Goal Trace: prints a message when the focus is changed. :v t ;; Verbose: If disabled, turns off all trace output. ) (Chunk-type goal) (Chunk-type something done success) (Add-DM (topgoal ISA goal)) (p Do-Again =goal> ISA goal ==> =newgoal> ISA something !push! =newgoal ) (p Good-Rule =goal> ISA something - done t ==> =goal> done t success t ) (p Bad-Rule =goal> ISA something - done t ==> =goal> done t success nil ) (p Goal-Success =goal> ISA something done t success t ==> !output! ("~%Success ratio: ~3F%" (success-ratio)) !pop! ) (p Goal-Failure =goal> ISA something done t - success t ==> !output! ("~%Success ratio: ~3F%" (success-ratio)) !pop! ) (spp (goal-success :success t) (goal-failure :failure t)) (goal-focus topgoal)