24.11.2014 Views

flex Expert System Toolkit - LPIS

flex Expert System Toolkit - LPIS

flex Expert System Toolkit - LPIS

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

11. Example – Robbie Goes Shopping 157<br />

10. Example - Robbie Goes Shopping<br />

We will now consider a <strong>flex</strong> example, using the KSL, adapted from the book<br />

Artificial Intelligence by Patrick Henry Winston (published by Addison<br />

Wesley), page 169.<br />

The Problem<br />

Robbie is a robot who bags groceries in the following way:<br />

• ask the user to choose their initial shopping list.<br />

• check that the list is 'complete' according to the requirements :<br />

• if any snacks are on the list then there is also a drink.<br />

• if butter is on the list then so is bread, and vice versa.<br />

• pack the items on the shopping according to the requirements :<br />

• pack any frozen items first.<br />

• pack the large items, beginning with any large bottles.<br />

• pack all the medium items.<br />

• finally, pack any remaining small items.<br />

We can consider the solution to this problem in two phases:<br />

1 The configuration phase - in which the initial shopping list is<br />

established.and then checked to see if everything necessary has been<br />

included. The shopping list is then adjusted accordingly.<br />

2 The resource allocation phase - in which the items on the final shopping<br />

list are packed into bags in terms of their size and type.<br />

The Configuration Section<br />

The initial shopping list is established and then checked, to see if everything<br />

necessary has been included. The shopping list is then adjusted accordingly.<br />

<strong>flex</strong> toolkit<br />

7

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

Saved successfully!

Ooh no, something went wrong!