HT Tutorial Exercise 5 - Scratch


OBJECTIVES

 
Adding a third operator, scratch-head
Create a new file, and in it create a Scratch-Head operator that:
     
  • Is always applicable or only applicable when ^itchy yes (your choice).
  • Has a single effect when applied, changing ^itchy to no if it was yes.

Write the four rules by analogy with existing proposal and application rules in hts9.soar. You will need:

     
  1. A proposal rule, like ht*propose-op*eat.

     

  2. An application rule, like ht*apply-op*eat.

     

  3. A rule that makes it worst (or best!), like ht*compare*eat*better*drink (You can make a unary preference by just deleting the compared object in the existing rule).

If the operator gets selected (e.g., if you make it best), it has to do something (i.e. modify an attribute) that will trigger the termination rule, or else an operator no-change impasse will be created. So make sure that you include a rule to have it do something. You might also wish to modify how the initial state gets created, but this depends on how the operator is implemented and what it assumes.

In order to make this file easy to use and make debugging easier, you will probably want to a put a line in your new file that loads hts9.soar (e.g., source hts9.soar). That way, when you load the new operator file, the ht code gets loaded too. Alternatively, you can first load hts9.soar by hand.


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