HT Tutorial Exercise 5 - Scratch


Adding a third operator, scratch-head

Create a new file, and in it create a Scratch-Head operator that:

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

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

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

  3. A termination rule, like ht*terminate*eat.

  4. 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), or else this will be detected and an operator no-change impasse will be created, so make sure that you include a rule to have it do something.

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 ht.s7 (e.g., source ht.s7). That way, when you load the new operator file, the ht code gets loaded too. Alternatively, you can first load ht.s7 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 Listing
PST Soar Help