[ACT-R-users] Retrieving sub-data

db30 at andrew.cmu.edu db30 at andrew.cmu.edu
Thu May 26 11:38:27 EDT 2022


--On Thursday, May 26, 2022 10:49 AM -0400 Philippe de Rochambeau 
<phiroc at free.fr> wrote:

> Hello,
> I am currently working on the below ACT-R Model.
> How do I retrieve man-1's number of eyes?
> Many thanks.
> Best regards,
> Phil
>
>
> ——————————————— Code ------------------------
> (clear-all)
>
> (define-model model1
>     (sgp :esc t :lf .05)
>
>     (chunk-type man name nbr-eyes nbr-hands nbr-feet)
>     (chunk-type retr-man man)
>
>     (add-dm
>         (man-1 ISA man name "John Doe"
>           nbr-eyes 2 nbr-hands 2 nbr-feet 2)
>         (retr-a-man ISA retr-man man man-1)
>     )
>
>     (P prod0
>       =goal>
>           ISA           retr-man
>           man         =h0
>       ==>
>       +goal>
>           ISA         retr-man
>           !output!     ("~%Man : ~a~%"
>                         =h0)
>     )
>     (goal-focus retr-a-man)
>
> )
>
>
> _______________________________________________
> ACT-R-users mailing list
> ACT-R-users at act-r.psy.cmu.edu
> https://mailman.srv.cs.cmu.edu/mailman/listinfo/act-r-users




Phil,

First, if you have not already done so, I would strongly recommend
working through the tutorial that is included with the ACT-R software.

To get the man's number of eyes you would need to retrieve the chunk
from declarative memory which contains that information.  That would
be done with a request to the retrieval buffer in the action of a
production: +retrieval>.  Then in another production you would need to
"harvest" that chunk with an =retrieval> condition to get the value
from the nbr-eyes slot of the chunk that was retrieved.

One note about that model is that you have set the man slot of the
chunk that is placed into the goal buffer to the name of the chunk in
declarative memory which you want to retrieve.  However, the name of
the chunk in declarative memory is not something the model can access.
The model can only access the contents of those chunks.  You will need
to use a value in a slot of that chunk, like the name, as a way to
retrieve it (although see note * below).  If the man slot of the
retr-a-man chunk were set to "John Doe", then a retrieval buffer
request like this in that production would retrieve the man-1 chunk:

+retrieval>
   name   =h0

Hope that helps,
Dan

* Technically one can use the name of a chunk to create an "indirect
request" which would work in this case, but that is not really the
appropriate approach for a situation like this.  The indirect request
mechanism is typically only used in two situations: when one has
created a hierarchy of chunks such that a chunk has another chunk in
one of its slots which must be retrieved (described in unit 5 of the
tutorial) or if the request that needs to be made is being built
incrementally in a buffer before making the request (described in unit
8 of the tutorial).



More information about the ACT-R-users mailing list