Environment.doc

273 views
176 views

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
273
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
2
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Environment.doc

  1. 1. ACT-R Environment The ACT-R environment provides functionality that is designed to facilitate developing and debugging models within ACT-R. The environment will run on either a Macintosh with Macintosh Common LISP (MCL) or a Windows 95/98/NT/2k/XP machine with Allegro Common LISP 5.0.1 (ACL). The two versions of the environment are very similar. There are only a few differences, which will be noted in the documentation. The environment includes a structured editing facility (only on the Macintosh), a model manager for managing files, and a suite of inspection utilities. The Models menu provides tools allowing you to open existing models and manage the files contained therein, create new models and run tutor exercises and to bring up the ACT-R control panel for running ACT-R models and inspecting ACT-R data structures. Models An ACT-R model is a text file(s) that contains ACT-R commands to perform a particular task, and possibly Lisp functions to implement the task with which ACT-R will interact. When opening an ACT-R file as an environment model, the file is separated into five components. Each of these is displayed in a separate window. These components include Chunk-types, Chunks, Productions, Misc definitions and lisp or ACT-R Commands. Model Components The Chunk Types window is used to define all chunk-types for the current model. The Chunks window is used to specify all declarative memory elements. The Productions window is used to create and modify all productions for the current model. The Misc window is used for lisp definitions such as calls to defun or defvar that define functions and variables. Finally, the Commands window typically contains ACT-R commands. Model Manager Every model has a Model Manager window. This window allows you to add other files to a model (for advanced users) and to select between model components for editing. For most users, the Model Manager is only useful when you are using a small screen and don't want all of the model components displayed simultaneously. You can close these windows and use the manager to display and edit a subset of the components. If you do not wish to use the model manager, you can close it at any time without affecting the model. If you are using the Macintosh version of the environment the Model Manager also allows you to switch between using the structured editor and normal text editing for the model windows. To change one of the edit windows to a normal edit window do the following: 1) Close the window which you want to edit freely 2) Open the Model Manager window (it's on the Models menu) 3) In the selection box pick the window you want to edit freely 4) Click the Edit button (not the S-Edit button) Closing Model Manager To close the Model Manager, simply click in the close box, which is located at the top left corner of the Model Manager window on a Macintosh, and the top right corner on a Windows machine. Opening Model Manager From the Models menu, select the Model Manager menu item. The Model Manager will now be displayed. Creating a new model From the Models menu, select the New Model menu item. Using the displayed dialog for naming a new file, navigate to a folder where you want the model to be saved. Supply a name for the
  2. 2. model and click the Save button. A new file with the name you supplied is created at this location. Opening an existing model From the Models menu, select the Open Model menu item. Using the presented file dialog, navigate to the location of the ACT-R file you wish to open as a model and select that file. Click the Open button. The model will now be opened and displayed for you. When you open the model, the code is automatically loaded so that you can immediately begin running the model. Closing a model From the Models menu, choose the Close Model menu item. If you have not saved all changes, you are prompted as to whether or not you would now like to save changes before closing. Saving a model From the Models menu, choose the Save Model menu item. This will save changes to all of the model components. You can also save individual components while editing a model. When you want to save the active window use the File | Save command or the hot key Command-S on a Macintosh and Ctrl-S on a Windows machine. Tutor Models From the Models menu, choose the Tutor Models menu item. This action allows you to select one of the tutor exercises named in Unit 1 of the course text. Using the displayed choose file dialog, navigate to a folder where you would the Tutor model file to be stored. Supply any name for this model and click the Save button. All components are now displayed and you may begin the exercise. Structured Editor Note : This feature is only available on the Macintosh version of the environment. The environment enforces structured editing of all model components but the Misc window. When editing, the editing environment enforces correct syntax and flags errors in boldface. Initially, model windows contain basic editing templates that contain place holder nodes. Place holder nodes are items that need to be coded. These are displayed as text surrounded by curly braces ("{" and "}"). When you edit a place holder node, your text appears where the place holder node was displayed. Depending on the node you edited, other nodes may be created or deleted automatically. Selecting an item Note : This is only relevant for the structured editor, which is only available on the Macintosh version of the environment. Within a window, there is always an active selection. This selection is shown in reverse video. There are several ways to change the current selection: Mouse: You may use the mouse and simply click on another item in the window. Arrow Keys: The UpArrow and LeftArrow keys move the current selection back up to the beginning of the file. The DownArrow and RightArrow advance the current selection forward from its current position. Shift+Arrow Keys: By using the arrow keys while holding the Shift key down, the active selection will change to Place holder Nodes only. This can be useful when you are scanning for extraneous nodes to delete when you have finished entering code. Automatically: After editing any selection, the environment automatically advances the current selection to the next editable item in the window.
  3. 3. Selecting non-atomic elements Note : This is only relevant for the structured editor, which is only available on the Macintosh version of the environment. Sometimes you may need to select non-atomic elements while editing (e.g. a chunk within a production) in order to create new place holder nodes. You can do this by multiple mouse clicking on an atomic element. As you progress through a multi-click sequence, successive parent elements in the syntax tree become highlighted. Note that this implies when you click on or to the right of syntactic delimiters such as "==>" in a production, ">" in a chunk, or parentheses, their corresponding parents are highlighted, in this case the production, the chunk, or the corresponding form, respectively. Editing an Item Note : This is only relevant for the structured editor, which is only available on the Macintosh version of the environment. To edit the current selection, you simply need to start typing. The text will appear in the place of the current selection. When you have finished entering the text for a particular item, you may press any whitespace key (Return, Spacebar, Tab) to indicate to the editor that you have completed editing the current item. If you have entered text that the editor recognizes as incorrect, you will receive a warning message indicating the problem and the entered text will be flagged in boldface. When you have made the correction, the text will appear normally. Deleting an item Note : This is only relevant for the structured editor, which is only available on the Macintosh version of the environment. To delete the current selection, press the delete or del key. Creating place holder nodes Note : This is only relevant for the structured editor, which is only available on the Macintosh version of the environment. You can create new place holder nodes at any time. To spawn a new place holder node of the same type as the current selection, simply hold down the Control key while pressing the RightArrow key. This will insert a new place holder node to the right of the current selection. Note that for certain types of nodes, you may have to select a non-atomic element. Saving changes in active window Note : This is only relevant for the structured editor, which is only available on the Macintosh version of the environment. To save the changes made to the current window, use the standard Macintosh Command-S save command, or choose File | Save from the menu bar. **Special Notes for Tutor Models** Note : This is only relevant for the structured editor, which is only available on the Macintosh version of the environment. There are some slight differences from editing under the standard environment: Deleting an item: Once you have coded a placeholder node correctly, you cannot delete it. Asking for help: I f you need help on coding the current selection, you can ask the system for help by pressing the Help key or using the Ctrl-E key combination. Saving: While you can save a tutor model, you can NOT reload an unfinished tutor model in Tutoring mode. You should always complete the entire tutor problem in a single session.
  4. 4. Lisp Checker Note : This feature is only available in the Windows version of the environment. Since the Windows version does not have the structured editor, the Lisp checker option was added in its place. At the bottom of the model menu is an item called Lisp Checker. It is off by default, but if you select it, it will be enabled. When it is on there will be a checkmark to the left of it. When it is active, it will check your model for syntax errors when it is initially loaded, and every time that the model is reloaded. If an error is found during the initial loading an error dialog will appear, and the model will be opened in a single window with the approximate location of the error highlighted. There may be a very large portion of the model highlighted for some errors. The error is usually located near the beginning of the highlighted text. You should correct the error and save the model, then open it again. When the error is detected during the reloading of an open model, the text that caused an error will be highlighted in the appropriate window. You should correct the error and then reload the model. Control Panel The control panel is a floating window that provides you with buttons for controlling the running of a model and for opening various viewer windows. Running Tools Reloading a model To reload the current model, click on the Reload button in the control panel. This cleans up the system and reloads your model so that any changes you have made can take effect. Editing changes do not take effect until you execute a reload. Pressing the Reload button automatically saves the current model. Resetting a model To reset the current model, click on the Reset button in the control panel. This cleans up the system to its state after the last loading of the model i.e. it undoes all interactive commands, production firings, etc. It is faster than reloading, but does not include updates made to the model files since the previous loading. Editing changes do not take effect until you execute a reload. Running a model From the control panel, simply click the Run button. This will begin a run from the current state of your model until no productions can fire or the requested amount of model time has passed. To run the model from its initial state, make sure you have used Reload to reload the current model before running. Run Arguments The default argument to Run appears in an editable text item next to the Run button. Notice that the argument defaults to 10.0. This is the maximum amount of time for which the model will run when the Run button is pressed. It may run for less time than that if there are no productions that will fire. The Stepper button To bring up the Instantiation viewer (the stepping tool), click the Stepper button in the control panel. The Instantiation viewer is the only viewer that is not passive. When this viewer is displayed, normal ACT-R running is interrupted during every cycle. When you display this viewer and then Run your model, it intercepts ACT-R processing in order to display the current set of instantiations that the system has generated during the cycle. When you are done viewing the instantiations for the current cycle, click the Resume button to allow ACT-R to continue processing. If you've had enough and want to allow ACT-R to run normally, close the viewer window.
  5. 5. The left pane of the instantiation viewer lists all instantiations that have been generated in the current cycle. To view a particular instantiation, use the mouse to select it. The selected instantiation is displayed in the right pane of the viewer. Depending on the settings of ACT-R flags, different information will appear in the viewing pane. At a minimum, the instantiation's corresponding production will appear with the bindings of all production variables displayed in place of the variables. Stopping a run In the current system the Stop button does not actually stop the model, so it should not be used. Instead, to stop a run away model you need to interrupt the system. In MCL the way to do that is by pressing Command-. and in ACL right click on the ACL icon in the system tray (usually in the lower right hand corner of the screen) and select Interrupt LISP. Then, when the restart dialog appears, select Abort. Inspection Tools All viewers are invoked through buttons on the Control Panel. If the control panel is not currently displayed, go to the Models menu and select the Control Panel menu item. This will display the Control Panel. Inspecting Declarative Memory To bring up the Declarative Memory viewer, click the Declarative Memory button in the control panel. The left pane of the viewer lists all chunks that currently exist. To view a particular element, use the mouse to select it. The selected element is displayed in the right pane of the viewer. Depending on the settings of ACT-R flags, different information will appear in the viewing pane. At a minimum, the current activation of the item and the values for its slots are displayed. You may also select a filter to list only those chunks that are of a particular chunk-type. To select a filter, use the mouse to click on the Filter selection box in the viewer. You can select any valid chunk-type. Once you have selected a filter, only elements of that type are listed in the left pane of the viewer. To disable filtering and show all elements, select the filter "none". Inspecting Procedural Memory To bring up the Production viewer, click the Productions button in the control panel. The left pane of the viewer lists all productions that currently exist. To view a particular production, use the mouse to select it. The selected production is displayed in the right pane of the viewer. Depending on the settings of ACT-R flags, different information about the parameters associated with the production will also appear in the window. You may also select a filter to list only those productions of a particular type. The type of a production is defined to be the type of the goal buffer test that appears in the production left hand side. If there is no goal buffer test then the type of the production is the value t (true). To select a filter, use the mouse to click on the Filter selection box in the viewer. You can select any valid chunk type. Once you have selected a filter, only productions of that type are listed in the left pane of the viewer. To disable filtering and show all elements, select the filter "none". Using Why Not? When developing a model, you sometimes expect a particular production to fire. When you expect a particular production to fire at a point in the run, you may want to know why that production was not chosen to fire. At this point, you can use the production viewer to select the troublesome production and click the Why Not? button. Clicking Why Not? will display useful information in the Listener window indicating why the desired production did not fire in MCL, or pop up a message dialog with the information in ACL.
  6. 6. Set Button The Set button of the procedural memory viewer does not work correctly and should not be used. Tutor mode of the stepper window When doing Unit 1 exercises, you need to check the Tutor Mode checkbox in the Instantiation viewer. When you enable Tutor Mode, selected instantiations are displayed differently. The top of the viewing pane displays all production variables for the selected instantiation paired with dummy {binding} nodes. Below these, the production text is displayed. You now can edit all production variables by hand. This will give you practice toward understanding how the matching process occurs in ACT-R. To select a production variable for editing, use the mouse to select it. You can then type in the value that you think this variable should have. When you have finished entering the text for the item, hit any whitespace key (Enter, Tab, Spacebar) to complete the edit (note the Spacebar does not work to end the item when using the Windows environment). When you are correct, the bindings at the top of the view are updated and the selection advances to the next production variable. If your edit is incorrect a message box appears with an appropriate error message. Asking for Help When using tutor mode of the Instantiation viewer you can request help. The method is slightly different between the two versions of the environment. Macintosh: If you need help on a particular item, press the Help key or Ctrl-e. A message dialog with a helpful hint will appear. Windows: To get help on the currently selected item, right click on the text pane of the Instantiation viewer window. Then, if you want a hint as to how to find the correct answer, select hint from the menu. If you just want to get the answer, select help. A message dialog will appear with the type of help you requested. When you are finished with the help, click the OK button to continue. When you have fully instantiated the production you can click the Resume button to continue to the next production cycle. Inspecting the Buffers To bring up the main buffer viewer window, click the Buffers button in the Control Panel window. That will bring up a window with six sections, one for each buffer – Goal, Retrieval, Visual, Aural, Manual, and Vocal. For each buffer there is a button, a selection box, and a display line. The display line shows the value of the buffer component that corresponds to the current selection. Goal and Retrieval Buffers The goal and retrieval buffers currently have only one possible selection, which is contents. The display shows the name of the chunk that is currently in the buffer, or nil if the buffer is empty. Pressing the button for these buffers brings up the declarative memory viewer with the current contents chunk selected for inspection.
  7. 7. Visual and Aural Buffers The visual and aural buffers have several selections available. The modality, processor, preparation, and execution selections correspond to the values of the current state of the buffer, and can be either FREE or BUSY. The command slot shows the last command that was requested on the buffer. The location selection shows the chunk that corresponds to the current focus of the buffer, and the contents selection shows the chunk that corresponds to the object currently being attended. Pressing the button for the buffer brings up a window that shows all of the buffer’s information. Manual and Vocal Buffers The manual and vocal buffers also have several selections available. The modality, processor, preparation, and execution selections correspond to the values of the current state of the buffer, and can be either FREE or BUSY. The command slot shows the last command that was requested on the buffer. Pressing the button for the buffer brings up a window that shows all of the buffer’s information.

×