15.07.2013 Views

Soar Tutorial - the Cognitive Systems Group

Soar Tutorial - the Cognitive Systems Group

Soar Tutorial - the Cognitive Systems Group

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

26<br />

You will <strong>the</strong>n be prompted for <strong>the</strong> attribute name. Type in “jug”.<br />

This will add <strong>the</strong> jug structure to <strong>the</strong> Datamap. You can now right click on <strong>the</strong> jug structure, and select<br />

“Add Integer …” to add <strong>the</strong> contents attribute to <strong>the</strong> jug structure. Type in <strong>the</strong> name, and <strong>the</strong>n repeat this<br />

for <strong>the</strong> empty and volume attributes. If <strong>the</strong> attribute had values that were different possible symbols, you<br />

would use <strong>the</strong> “Add Enumeration …” selection. Your screen should now look like this:<br />

Now have Visual<strong>Soar</strong> check all productions against <strong>the</strong> Datamap (using <strong>the</strong> command under <strong>the</strong><br />

Datamap tab in <strong>the</strong> toolbar), you should have no errors. Make sure to save and feel free to close <strong>the</strong><br />

Datamap and initialize-water-jug windows.<br />

In <strong>the</strong> above rule, <strong>the</strong> variable is used to connect <strong>the</strong> first condition to <strong>the</strong> second. To simplify <strong>the</strong><br />

writing and reading of rules, <strong>Soar</strong> allows you to combine conditions that are linked by variables. To do<br />

this, you can just string toge<strong>the</strong>r attributes, replacing <strong>the</strong> intermediate variables with a period, “.”, to<br />

separate <strong>the</strong> attributes. In <strong>Soar</strong>, we call this “dot” or “path” notation. Below is <strong>the</strong> same rule as before<br />

using dot notation.<br />

sp {water­jug*apply*initialize­water­jug . replaces <br />

(state ^operator.name initialize­water­jug)<br />

­­><br />

( ^name water­jug<br />

^jug <br />

^jug )<br />

( ^volume 5<br />

^contents 0)<br />

( ^volume 3<br />

^contents 0)}<br />

<strong>Soar</strong> <strong>Tutorial</strong><br />

The folder “jug”<br />

has been added to<br />

<strong>the</strong> Datamap.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!