Multiple Values
Solving Multiple Problems
samples/basic/tutorial/diagnosis_4
The facts we've seen so
far have single values. And those values have typically been text.
It is also possible to let a fact have multiple values. This decision affects
certain types of knowledge objects. Those are:
- questions, where the user can enter multiple choices, and
- rule_sets, where multiple rules might apply.
To change the diagnostic system so that it can handle multiple problems at
once, make the following changes:
- Edit question symptom so that the question_type is menu_multiple_choices.
- Edit the rule_sets for action and problem, so that
the type is multiple_values. Change all of the '=' to 'include'. This is
needed because facts with multiple values are lists. There are special operators
to check the contents of a list such as include, exclude and number_of_items.
The '=' operator is used to check the entire contents of the list, e.g.
colors = [red, white, blue].
Run the system as before, only this time choose both symptoms when asked.
Notice that the system will now ask as many questions as it needs to find all
the problem(s) that apply.
Notice that the problem_report has all of the problems and actions listed.
As before, trace the execution of the system to understand how it works.
Copyright ©1996-2002 Amzi! inc. All Rights Reserved. Amzi!,
KnowledgeWright and WebLS are registered trademarks and Subscription Plus and
Logic Server are trademarks of Amzi! inc.