Upload
griffith-ward
View
17
Download
0
Embed Size (px)
DESCRIPTION
Reaction System. To ‘bag’ groceries. It does the following: Checks to see if a ‘cross-sale’ can be made. Bags the large items, ensuring bottles are the first items to be bagged. Then bags the medium items, putting frozen items in an insulated bag as necessary. - PowerPoint PPT Presentation
Citation preview
Reaction System
To ‘bag’ groceries. It does the following:
1. Checks to see if a ‘cross-sale’ can be made.2. Bags the large items, ensuring bottles are the
first items to be bagged.3. Then bags the medium items, putting frozen
items in an insulated bag as necessary.
NOTE: The system uses a Rule Ordering conflict resolution strategy!
Items to be Bagged:
Item Packaging Size Frozen?Joint of Beef Styrofoam Tray Medium NoCornflakes Box Large NoIce Cream Tub Medium Yes
Crisps Bag Medium NoPepsi Bottle Large No
These items are placed in the working memory (WM)
Working Memory
Step is check orderBag is Bag 1Beef to be baggedCornflakes to be baggedIce Cream to be baggedCrisps to be baggedPepsi to be bagged
Rule 1
Crisps are to be baggedPepsi is to be bagged RULE DOES NOT FIRE!
Rule 2Step is Check OrderRULE FIRES!WM: Step is bag large items Bag is Bag 1 Beef to be bagged Cornflakes to be bagged Ice Cream to be bagged Crisps to be bagged Pepsi to be bagged
Rule 3Step is bag large itemsThere is a large item to bagThere is a bottle to bagThe bag has less than 6 large itemsRULE 3 FIRES!WM: Step is bag large items Bag is Bag 1 Beef to be bagged Cornflakes to be bagged Ice Cream to be bagged Crisps to be bagged
Rule 4 (1)Step is bag large itemsThere is a large item to bagThe bag has less than 6 large itemsWM: Step is bag large items Bag is Bag 1 Beef to be bagged Ice Cream to be bagged Crisps to be bagged
NOTE: This rule may fire several times if there are several large items!
Rule 4 (2)Step is bag large itemsThere is a large item to bagThe bag has less than 6 large itemsWM: Step is bag large items Bag is Bag 1 Ice Cream to be bagged Crisps to be bagged
Rule 5Step is bag large itemsThere is a large item to bagThe current bag is fullAn empty bag is available WM: Step is bag large items Bag is Bag 2 Ice Cream to be bagged Crisps to be bagged
Rule 6
Step is bag large itemsWM: Step is bag medium items Bag is Bag 2 Ice Cream to be bagged Crisps to be bagged
Rule 7
Step is bag medium itemsThe medium item is frozen & not in insulated bagWM: Step is bag medium items Bag is insulated bag Crisps to be bagged
Rule 8
Step is bag medium itemsThe current bag is insulatedThere is a bag availableWM: Step is bag medium items Bag is Bag 3 Crisps to be bagged
Rule 9
Step is bag medium itemsThe current bag emptyA medium item is to be baggedWM: Step is bag medium items Bag is Bag 3
NOTE: The antecedent is disjunctive, so we don’t need to check the other antecedents as the first antecedent is satisfied!
Rule 10
Step is bag medium itemsWM: Step is done END!