CSCI-222 Expert Systems

Joseph Tappero

jtappero@pacbell.net


Lab Assignment: 1 - Rule Based Architecture

Wine Tasting Advisor

Wine Tasting - Algorithm

The following diagram depicts the algorithm used in generating candidate wine tasting sequences, (also known as "flights") based on user preference for color and guided by rules that determine which wines and in what order. In addition, the user is prompted for whether the selections should also reference available user-defined "favorites". The algorithm performs a series of screening and matching operations that generate wine candidates for each stage of the tasting. The implementation uses heuristics to determine the progression of wines from the first to last. Red wine sequences, for example, typically start with a preference for dry, low alcohol wines, proceeding to medium alcohol level wines, and finishing with either a dry, full bodied wines of higher alcohol content. Note: This sequence of tastings is fairly common at most vineyard wine tastings, with variations determined by the vintner or wine master. This tasting sequence helps to "guide" the participant's palette toward appreciating the last stage of the tasting, which is typically the pride or "featured" wine selection of the vineyard.

Based upon the user's response when prompted by the option to show favorites, the program either simply display recommendations for wine tasting sequences, or optionally present the recommendations matched with "favorites". The favorites are "looked up" from a supporting table of user-preferred vintages (the current program favorites were supplied by the program author after many enthusiatic wine tastings).

Sample Run 1 - Wine Tasting (sequence of 3 or 4)

Description - Run 1

The "Wine Tasting" option is run by selecting option [2] from the first menu option. The program then prompts for your wine color preference - for this sample run option [3] - any, was chosen. If option [1] red was taken, the flight selections would only be comprised of red wines. Similarly, if the white wine option was taken, the flights would only present white wines. In this case, by selecting the "any" option, the wine tasting flights will typically start with a dry white wine, then proceed through red wines, based upon the heuristics associated with each flight.

So What is the Program Doing?

The "Wine Tasting" algorithm is based partially upon classification, and partially upon constrained configuration methods, again using forward-chaining through a set of heuristically-guided rules. After determining the user's tasting preference, the program then proceeds through intermediate stages where it builds candidates for each tasting flight. During this phase the program assigns a rating to each candidate, based upon how well it conforms to the governing heuristics. The final set of tasting flights are only the highest rated combinations.

The following example demonstrates the output when the "show favorites" option is selected.

Sample Run 2 - Wine Tasting (sequence of 3 or 4)

Description - Run 2

In this case, by chosing the "show favorites" option, the program not only generates candidate wine tasting sequence following the algorithm described above, it also matches selections with the user's "favorite" wine selections knowledgebase. (Note: The specific selections demonstrated here are from the author's private collection.)

Usefulness and Limitations

The usefulness of this program is derived from actually using the program to generate wine tasting sequences, then trying them out! More realistically, implementing this part of the Wine Tasting Advisor required more thought put into how the rules-based engine worked. Specifically, it required developing a better understanding of mixing representation with control.

This aspect of the Wine Tasting Advisor is linited by the same restrictions as the the Wine Selecting option discussed in the first section of this project. In addition, the selection of wines for a tasting sequence is limited by both expertise in wines not embodied by the knowledgebase that was implemented, and a the inability to add "creativity" to the selections. One way to over-come part of this deficiency would be to modularize the screening and matching algorithm using a strategy design pattern, coupled with either user-based preferences or other form of logic to add variation to the generation of candidate wines for the stages of the wine tasting sequences.

Overall though, the generated tasting flights come reasonably close to actual tasting room experiences.