HT Tutorial Exercise 2 - Run the model


Loading and running the hungry-thirsty code

Make sure Soar is empty, either by typing excise --all, or by quitting from Soar (with an exit command) and starting a new one (see how to startup Soar if you forgot). Then load the ht.s9 file, by typing:

source hts9.soar (or use the File:Load menu on the Soar Debugger).

If you now init-soar (or use the GUI) and type d 2, Soar will run two decision cycles until the problem is solved and then halt. You can then examine the trace (what Soar prints out as it runs), to see what happened (this trace is also shown in Trace 3). Alternatively, you can type d 1, and examine each object as it is selected.

(If you get tired of making mistakes while typing init-soar, you can simply type is instead. The abbreviation "is" is called an alias. Most other commands have aliases too. For example, p for print. See the command help for a list.)

Several of the attributes in this model are traced (such as hungry and thirsty on the state), but there are several that are not. You can examine the problem space elements (and their substructures) in their entirety by typing the p command followed by the identifier of the element. The identifier of each context element appears in the trace, such as S1, so an example usage would be p s1. This command can be recursively applied to sub-objects, or you can find out how to print them all at once by consulting help print.

If you lose track of where you are in the model, the "Monitor printStack" window shows the current Context Stack. The current state is the state that is lowest down in the goal stack. Alternatively, you can type p -s to Print (the Context) Stack in the main window.

Follow up questions

  1. How is this behaviour different from another production system or expert system shell (e.g., Jess)?


  2. What happens if you "excise ht*compare*eat*better*drink"?


  3. How would you extend the model from a single to double conjunct goal? (i.e. to be not hungry and not thirsty?).

Return to main page of: Introduction to Psychological Soar Tutorial
(or use the Back button to return to where you just were).
Program Listings
PST Soar Help