[ACT-R-users] ACT-R within LISP program

Dan Bothell db30 at andrew.cmu.edu
Thu Aug 29 14:24:53 EDT 2002


--On Thursday, August 29, 2002 10:46 AM -0700 Stephane Gamard <gamars at rpi.edu> 
wrote:

>     I seeking for help regarding a problem I have with ACT-R. I am not
> myself a good programmer with LISP and I would like to integrate ACT-R to a
> program in LISP. The prob though is that ACT-R need to be ran as a child
> process (in order not to block the rest of the program). I've been trying to
> get it to work for the past few month but my LISP skills (rather the lack of
> them) is a very big limitation. Would someone have some example code and/or
> correct me on a small example such as the one at the bottom.      Thanks to
> all,
>
> _Stephane
>
>
> Code:
>
> (in-package :common-graphics-user)
>
> (eval-when (:compile-top-level :load-top-level :execute)
>   (use-package :multiprocessing)
>   (require :process))
>
>
> (defun testactr ()
>   (load-model-fct "drunken" "sys:active;UT-bot;ACT-R;")
>   (format t "~&-------> Getting the thread to run ~&")
>    (mp:process-run-function "act-r" (run))
>   (format t "~&+-+-+-+> outside the thread ~&")
>   (loop for n from 1 to 100
>         do (format t " _-_-_-_->> interfearences !!!! ;-)~&")))



There is one error in that and a couple of potentially difficult issues. 
First, the process-run-function in ACL requires a function as the second 
parameter, but you are passing it the result of calling run which is not a 
function.  Instead you should use:

(mp:process-run-function "act-r" #'run-fct)

The issues have to do with continuous running and synchronization.  The ACT-R 
run function returns when there isn't anything for the model to do (no 
productions to fire).  So unless there are some very generic productions in 
the model to ensure that there's always one that will fire the run function 
will return as soon as it hits such a situation which will terminate that 
process.  The other issue is synchronization.  With run being handled by the 
ACL scheduler there's no gurantees as to when it's going to get a chance to 
run.  I guess the bigger question is why do you need to run ACT-R in a 
separate process?

Dan




More information about the ACT-R-users mailing list