24.11.2014 Views

flex Expert System Toolkit - LPIS

flex Expert System Toolkit - LPIS

flex Expert System Toolkit - LPIS

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

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

then include bread in the shopping<br />

and write( 'Including bread on shopping list' )<br />

and nl<br />

because What is the use of butter without bread .<br />

Having written the compatibility rules, we need to determine how they will<br />

be used.<br />

Because there is no conflict between these rules (i.e. they do not compete by<br />

having overlapping conditions) the order in which they are used is not<br />

important. It is therefore best to select them on a first come first served<br />

basis.<br />

Also, once each rule has been selected and fired, its conditions can no<br />

longer apply. In this case the most efficient way of updating the ruleset is by<br />

removing each selected rule, which is equivalent to firing each rule once<br />

only.<br />

The ruleset that governs the checking rules would be written in KSL as<br />

follows.<br />

ruleset checking_rules<br />

contains<br />

check_snacks,<br />

check_bread_and_butter,<br />

check_butter_and_bread ;<br />

select rule using first come first served ;<br />

update ruleset by removing each selected rule .<br />

The Resource Allocation Section<br />

In this section the items on the final shopping list are packed into carrier<br />

bags in terms of their type, container and size .<br />

The Packing Rules<br />

The packing is to be done according to container type and size. Therefore<br />

we can classify the data as follows.<br />

The main difference between each of the goods is their size, which can be<br />

either large, medium or small.<br />

The packing requirements are that only three medium and small items are<br />

allowed in a bag and only one large item is allowed in any bag.<br />

frame item<br />

default maximum_allowed is 3 .<br />

frame large_item is an item<br />

default size is large<br />

and default maximum_allowed is 1 .<br />

<strong>flex</strong> toolkit

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

Saved successfully!

Ooh no, something went wrong!