[ACT-R-users] Question on new visual objects and accessing in productions

Shawn Nicholson shawn.nicholson at dnamerican.com
Fri Jul 1 15:32:12 EDT 2005


Hello,
  I am trying to scan and encode objects that aren't of the predefined
types and which will have different (more) slots describing properties
of the visual objects.
 
To accomplish this a new icon-feature subclass was created (called
aircraft-icon) and it was given an initial additional slot called
direction (indicating the orientation of the aircraft icon with respect
to a fixed location).
 
(defclass aircraft-icon (actr:icon-feature)
  ((actr:direction :accessor actr:direction :initarg :direction
 :initform 0))
  (:default-initargs
   :kind 'actr:visual-object))
 
 
Additionally, build-group-features-for methods were specialized on this
new aircraft-icon to compute and fill in the visicon properly (with the
new slot). 
 
When I run such a system, I can initiate visual-location requests like:
 
+visual-location>
  isa    visual-location
  kind   visual-object
  value  :friendly   <-- that slot is set in the
build-group-features-for
 
 
This works, and I can then do a move-attention in the visual module
given the retrieved visual-location.
 
However, there is no direction slot in the chunk. If I change the slot
setting of, say, :height in build-groups-features-for to the result of
computing the aircraft direction, then the chunk will have the direction
instead of height specified.  But there won't be a direction slot at
all.
 
 
To get the direction slot, I changed my definition of the aircraft-icon
class to set the default value for kind to something other than
visual-object
 
(defclass aircraft-icon (actr:icon-feature)
  ((actr:direction :accessor actr:direction :initarg :direction
 :initform 0))
  (:default-initargs
   :kind 'actr::aircraft-object))
 
and then, in my model, put 
 
  (chunk-type (aircraft-object (:include visual-object)) direction)
  (define-chunks (aircraft-object isa chunk))
 
With this change I know do visual-requests where the KIND slot is
aircraft-object and when I run my model, the visual chunk returned does
have the direction slot in it.  However, it was always NIL (even though
it was set properly in the visicon - inspecting that when all was done
had the correct values in the visicon objects).
 
I then proceeded to add a method feat-to-dmo specialized on the
aircraft-icon class identical to the default with one exception - I
added a direction filler.
 
(defmethod actr::feat-to-dmo ((feat aircraft-icon))
   (setf (actr::attended-p feat) t)
   (actr::make-dme (actr::dmo-id feat) (actr::kind feat)
                   `(actr::screen-pos ,(actr::id (actr::xy-to-dmo
(actr::xy-loc feat) t))
                                      actr::value ,(actr::val feat)
                                      actr::color ,(actr::color feat)
                                      actr::height ,(actr::height feat)
                                      actr::width ,(actr::width feat)
                                      actr::direction ,(actr::direction
feat)
                                      )
                   :obj (actr::screen-obj feat)
                   :where :external))
 
 
Now, everything works.  But I am wondering if what I have done is the
proper method for manipulating specialized icon objects in the vision
module. My questions (in summary):
 
1)    Is this the proper way to be adding new visual object types to the
system for accessing special slots and such?  (ie adding that
feat-to-dmo method specialized on aircraft-icon??) 
2)    Those two lines that I placed in my model seem like they should be
somewhere in the code where the aircraft-icon feature is defined.
However, unless I put them in the model, anytime (clear-all) is called,
the chunk types go away and they no longer exist for use in the
productions.  I could put and advice function around the function
reset-vision-module (which is where all the basic vision chunks are
defined) but that doesn't seem to be a clean way to change things. 
 
Sorry for the long winded question.  I'm new to this and want to know
how to do these things properly.
 
Thank you,
  Shawn Nicholson
 
 
=======================================
Shawn Nicholson
Research Engineer
D.N. American
shawn.nicholson at dnamerican.com
Ph: (304) 363-6757
Public PGP/GPG Key ID: 0x24A58D96
=======================================
 
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.srv.cs.cmu.edu/pipermail/act-r-users/attachments/20050701/9302c385/attachment.html>


More information about the ACT-R-users mailing list