[ACT-R-users] Need capability to change chunk type when new slots are added to an existing chunk

Dan Bothell db30 at andrew.cmu.edu
Tue Feb 10 12:39:06 EST 2009



--On Monday, February 09, 2009 5:53 PM -0500 "Ball, Jerry T Civ USAF AFMC 
711 HPW/RHAC" <Jerry.Ball at mesa.afmc.af.mil> wrote:

> Our primary use would be to specialize a chunk into a
> pre-defined chunk subtype consistent with the added slot(s).
>


Without considering the entire context of what you want, it is (almost)
possible to have modules do this part of things - assuming that a
new chunk in the buffer is sufficient.  So, you may be able to add new
modules or modify ones which you have to do this and see what you get.

A buffer modification request in a p* will (now) pass arbitrary slot
names to a module and the module can do whatever it wants to the chunk
in the buffer including overwriting it with another chunk of any type.
I'd recommend the overwrite so as to not flush the 'incomplete' one to DM.

The qualifiers of almost and now above reflect that priory to r732
there was actually a validation test which would prevent a module
from doing that, but if you checkout the most up to date sources
you can do what's described there with p*.

Below is a stub of a module which uses a buffer modification request
to create a new chunk for a buffer of a fixed type and slots which are
all predefined.  It doesn't copy any of the slot values from the chunk
currently in the buffer, but that wouldn't take too much more to add.
There's also an extremely simple model which uses that along with a
trace of it running.

So, you should now be able to try something like that out with your
own modules to see if it gives you what you need.

Dan


(defun modify-to-type-new (module buffer slot-value-list)
  (schedule-overwrite-buffer-chunk
   buffer (car (define-chunks-fct (list (append '(isa new) 
slot-value-list))))
   0
   :module 'change-chunk))

(defun dummy-queries (module queries)
  t)

(define-module change-chunk (change) nil
  :version "" :documentation ""
  :buffer-mod  modify-to-type-new
  :query dummy-queries)



(define-model test

  (chunk-type goal new-slot)
  (chunk-type old)
  (chunk-type new slot)

  (goal-focus-fct (car (define-chunks (isa goal new-slot slot))))
  (set-buffer-chunk 'change (car (define-chunks (isa old))))

  (p* match-old-request-change
      =goal>
       isa goal
       new-slot =slot-name
      =change>
       isa old
      ==>
      +change>
       =slot-name 10)

  (p match-to-new
     =goal>
      isa goal
     =change>
      isa new
      slot 10
     ==>
     ))


CG-USER(23): (run 10)
     0.000   GOAL                   SET-BUFFER-CHUNK GOAL GOAL0 REQUESTED 
NIL
     0.000   PROCEDURAL             CONFLICT-RESOLUTION
     0.050   PROCEDURAL             PRODUCTION-FIRED 
MATCH-OLD-REQUEST-CHANGE
     0.050   CHANGE-CHUNK           OVERWRITE-BUFFER-CHUNK CHANGE NEW0 
REQUESTED NIL
     0.050   PROCEDURAL             CONFLICT-RESOLUTION
     0.100   PROCEDURAL             PRODUCTION-FIRED MATCH-TO-NEW
     0.100   PROCEDURAL             CLEAR-BUFFER CHANGE
     0.100   PROCEDURAL             CONFLICT-RESOLUTION
     0.100   ------                 Stopped because no events left to 
process
0.1
19
NIL





More information about the ACT-R-users mailing list