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.

42<br />

water­jug*apply*operator*remove*old*last­operator*pour<br />

If <strong>the</strong> task is water­jug and a pour operator is selected and last­operator<br />

does not have <strong>the</strong> same name and fill­jug, <strong>the</strong>n remove <strong>the</strong> last­operator.<br />

sp {water­jug*apply*operator*remove*last­operator*pour<br />

(state ^name water­jug<br />

^operator <br />

^last­operator )<br />

( ^name pour<br />

^fill­jug <br />

^empty­jug )<br />

­( ^name pour<br />

^fill­jug <br />

^empty­jug )<br />

­­><br />

( ^last­operator ­)}<br />

Once you add <strong>the</strong>se rules, add rules that avoid applying an operator that undoes <strong>the</strong> previous operator<br />

(you should write <strong>the</strong>se yourself).<br />

water­jug*select*operator*avoid*inverse*fill<br />

If <strong>the</strong> task is water­jug and <strong>the</strong> last operator is empty <strong>the</strong>n avoid a fill.<br />

water­jug*select*operator*avoid*inverse*empty<br />

If <strong>the</strong> task is water­jug and <strong>the</strong> last operator is fill <strong>the</strong>n avoid an empty.<br />

water­jug*select*operator*avoid*inverse*pour<br />

If <strong>the</strong> task is water­jug and <strong>the</strong> last operator is pour from one jug <strong>the</strong>n<br />

avoid a pour <strong>the</strong> opposite way.<br />

sp {water­jug*select*operator*avoid*inverse*fill<br />

(state ^name water­jug<br />

^operator +<br />

^last­operator )<br />

( ^name fill ^fill­jug )<br />

( ^name empty ^empty­jug )<br />

­­><br />

( ^operator <br />

( ^operator <br />

( ^operator

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

Saved successfully!

Ooh no, something went wrong!